fix: links not working when controls are disabled
This commit is contained in:
		
							
								
								
									
										12
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -353,7 +353,6 @@ var Reveal = (function(){ | |||||||
| 		createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null ); | 		createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null ); | ||||||
|  |  | ||||||
| 		// Cache references to elements | 		// Cache references to elements | ||||||
| 		if ( config.controls ) { |  | ||||||
| 		dom.controls = document.querySelector( '.reveal .controls' ); | 		dom.controls = document.querySelector( '.reveal .controls' ); | ||||||
|  |  | ||||||
| 		// There can be multiple instances of controls throughout the page | 		// There can be multiple instances of controls throughout the page | ||||||
| @@ -363,7 +362,6 @@ var Reveal = (function(){ | |||||||
| 		dom.controlsDown = toArray( document.querySelectorAll( '.navigate-down' ) ); | 		dom.controlsDown = toArray( document.querySelectorAll( '.navigate-down' ) ); | ||||||
| 		dom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) ); | 		dom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) ); | ||||||
| 		dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) ); | 		dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) ); | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -491,9 +489,7 @@ var Reveal = (function(){ | |||||||
| 		dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed ); | 		dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed ); | ||||||
| 		dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition ); | 		dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition ); | ||||||
|  |  | ||||||
| 		if( dom.controls ) { |  | ||||||
| 		dom.controls.style.display = ( config.controls && dom.controls ) ? 'block' : 'none'; | 		dom.controls.style.display = ( config.controls && dom.controls ) ? 'block' : 'none'; | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 		if( dom.progress ) { | 		if( dom.progress ) { | ||||||
| 			dom.progress.style.display = ( config.progress && dom.progress ) ? 'block' : 'none'; | 			dom.progress.style.display = ( config.progress && dom.progress ) ? 'block' : 'none'; | ||||||
| @@ -586,7 +582,6 @@ var Reveal = (function(){ | |||||||
| 			dom.progress.addEventListener( 'click', onProgressClicked, false ); | 			dom.progress.addEventListener( 'click', onProgressClicked, false ); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		if ( config.controls && dom.controls ) { |  | ||||||
| 		[ 'touchstart', 'click' ].forEach( function( eventName ) { | 		[ 'touchstart', 'click' ].forEach( function( eventName ) { | ||||||
| 			dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); | 			dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); | ||||||
| 			dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); | 			dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); | ||||||
| @@ -595,7 +590,6 @@ var Reveal = (function(){ | |||||||
| 			dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); | 			dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); | ||||||
| 			dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); | 			dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); | ||||||
| 		} ); | 		} ); | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -624,7 +618,6 @@ var Reveal = (function(){ | |||||||
| 			dom.progress.removeEventListener( 'click', onProgressClicked, false ); | 			dom.progress.removeEventListener( 'click', onProgressClicked, false ); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		if ( config.controls && dom.controls ) { |  | ||||||
| 		[ 'touchstart', 'click' ].forEach( function( eventName ) { | 		[ 'touchstart', 'click' ].forEach( function( eventName ) { | ||||||
| 			dom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } ); | 			dom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } ); | ||||||
| 			dom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } ); | 			dom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } ); | ||||||
| @@ -633,7 +626,6 @@ var Reveal = (function(){ | |||||||
| 			dom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } ); | 			dom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } ); | ||||||
| 			dom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } ); | 			dom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } ); | ||||||
| 		} ); | 		} ); | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -1792,8 +1784,6 @@ var Reveal = (function(){ | |||||||
| 	 */ | 	 */ | ||||||
| 	function updateControls() { | 	function updateControls() { | ||||||
|  |  | ||||||
| 		if ( config.controls && dom.controls ) { |  | ||||||
|  |  | ||||||
| 		var routes = availableRoutes(); | 		var routes = availableRoutes(); | ||||||
| 		var fragments = availableFragments(); | 		var fragments = availableFragments(); | ||||||
|  |  | ||||||
| @@ -1838,8 +1828,6 @@ var Reveal = (function(){ | |||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Updates the background elements to reflect the current  | 	 * Updates the background elements to reflect the current  | ||||||
| 	 * slide. | 	 * slide. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user