* Mobile Linear Navigation: Fix swipes to navigate linearly
This commit is contained in:
		
							
								
								
									
										32
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -3951,7 +3951,7 @@ | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		if( config.navigationMode === "linear" ) { | 		if( config.navigationMode === 'linear' ) { | ||||||
| 			routes.right = routes.right || routes.down; | 			routes.right = routes.right || routes.down; | ||||||
| 			routes.left = routes.left || routes.up; | 			routes.left = routes.left || routes.up; | ||||||
| 		} | 		} | ||||||
| @@ -5441,20 +5441,50 @@ | |||||||
|  |  | ||||||
| 				if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { | 				if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { | ||||||
| 					touch.captured = true; | 					touch.captured = true; | ||||||
|  | 					if (config.navigationMode === 'linear') { | ||||||
|  | 						if( config.rtl ) { | ||||||
|  | 							navigateNext(); | ||||||
|  | 						} | ||||||
|  | 						else { | ||||||
|  | 							navigatePrev(); | ||||||
|  | 						} | ||||||
|  | 					} | ||||||
|  | 					else { | ||||||
| 						navigateLeft(); | 						navigateLeft(); | ||||||
| 					} | 					} | ||||||
|  | 				} | ||||||
| 				else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { | 				else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { | ||||||
| 					touch.captured = true; | 					touch.captured = true; | ||||||
|  | 					if (config.navigationMode === 'linear') { | ||||||
|  | 						if( config.rtl ) { | ||||||
|  | 							navigatePrev(); | ||||||
|  | 						} | ||||||
|  | 						else { | ||||||
|  | 							navigateNext(); | ||||||
|  | 						} | ||||||
|  | 					} | ||||||
|  | 					else { | ||||||
| 						navigateRight(); | 						navigateRight(); | ||||||
| 					} | 					} | ||||||
|  | 				} | ||||||
| 				else if( deltaY > touch.threshold ) { | 				else if( deltaY > touch.threshold ) { | ||||||
| 					touch.captured = true; | 					touch.captured = true; | ||||||
|  | 					if (config.navigationMode === 'linear') { | ||||||
|  | 						navigatePrev(); | ||||||
|  | 					} | ||||||
|  | 					else { | ||||||
| 						navigateUp(); | 						navigateUp(); | ||||||
| 					} | 					} | ||||||
|  | 				} | ||||||
| 				else if( deltaY < -touch.threshold ) { | 				else if( deltaY < -touch.threshold ) { | ||||||
| 					touch.captured = true; | 					touch.captured = true; | ||||||
|  | 					if (config.navigationMode === 'linear') { | ||||||
|  | 						navigateNext(); | ||||||
|  | 					} | ||||||
|  | 					else { | ||||||
| 						navigateDown(); | 						navigateDown(); | ||||||
| 					} | 					} | ||||||
|  | 				} | ||||||
|  |  | ||||||
| 				// If we're embedded, only block touch events if they have | 				// If we're embedded, only block touch events if they have | ||||||
| 				// triggered an action | 				// triggered an action | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user