fix navigatePrev in rtl mode #1030
This commit is contained in:
		
							
								
								
									
										30
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								js/reveal.js
									
									
									
									
									
								
							@@ -3426,10 +3426,20 @@
 | 
			
		||||
				navigateUp();
 | 
			
		||||
			}
 | 
			
		||||
			else {
 | 
			
		||||
				// Fetch the previous horizontal slide, if there is one
 | 
			
		||||
				var previousSlide;
 | 
			
		||||
 | 
			
		||||
				if( config.rtl ) {
 | 
			
		||||
					navigateRight();
 | 
			
		||||
				} else {
 | 
			
		||||
					navigateLeft();
 | 
			
		||||
					previousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.future' ) ).pop();
 | 
			
		||||
				}
 | 
			
		||||
				else {
 | 
			
		||||
					previousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.past' ) ).pop();
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if( previousSlide ) {
 | 
			
		||||
					var v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;
 | 
			
		||||
					var h = indexh - 1;
 | 
			
		||||
					slide( h, v );
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -3437,16 +3447,20 @@
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Same as #navigatePrev() but navigates forwards.
 | 
			
		||||
	 * The reverse of #navigatePrev().
 | 
			
		||||
	 */
 | 
			
		||||
	function navigateNext() {
 | 
			
		||||
 | 
			
		||||
		// Prioritize revealing fragments
 | 
			
		||||
		if( nextFragment() === false ) {
 | 
			
		||||
			if( config.rtl ) {
 | 
			
		||||
				availableRoutes().down ? navigateDown() : navigateLeft();
 | 
			
		||||
			} else {
 | 
			
		||||
				availableRoutes().down ? navigateDown() : navigateRight();
 | 
			
		||||
			if( availableRoutes().down ) {
 | 
			
		||||
				navigateDown();
 | 
			
		||||
			}
 | 
			
		||||
			else if( config.rtl ) {
 | 
			
		||||
				navigateLeft();
 | 
			
		||||
			}
 | 
			
		||||
			else {
 | 
			
		||||
				navigateRight();
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user