prevent overview click events after calling Reveal.removeEventListeners
This commit is contained in:
		| @@ -129,6 +129,9 @@ var Reveal = (function(){ | |||||||
| 		// A delay used to deactivate the overview mode | 		// A delay used to deactivate the overview mode | ||||||
| 		deactivateOverviewTimeout = 0, | 		deactivateOverviewTimeout = 0, | ||||||
|  |  | ||||||
|  | 		// Flags if the interaction event listeners are bound | ||||||
|  | 		eventsAreBound = false, | ||||||
|  |  | ||||||
| 		// Holds information about the currently ongoing touch input | 		// Holds information about the currently ongoing touch input | ||||||
| 		touch = { | 		touch = { | ||||||
| 			startX: 0, | 			startX: 0, | ||||||
| @@ -390,6 +393,8 @@ var Reveal = (function(){ | |||||||
| 	 */ | 	 */ | ||||||
| 	function addEventListeners() { | 	function addEventListeners() { | ||||||
|  |  | ||||||
|  | 		eventsAreBound = true; | ||||||
|  |  | ||||||
| 		window.addEventListener( 'hashchange', onWindowHashChange, false ); | 		window.addEventListener( 'hashchange', onWindowHashChange, false ); | ||||||
| 		window.addEventListener( 'resize', onWindowResize, false ); | 		window.addEventListener( 'resize', onWindowResize, false ); | ||||||
|  |  | ||||||
| @@ -424,6 +429,8 @@ var Reveal = (function(){ | |||||||
| 	 */ | 	 */ | ||||||
| 	function removeEventListeners() { | 	function removeEventListeners() { | ||||||
|  |  | ||||||
|  | 		eventsAreBound = false; | ||||||
|  |  | ||||||
| 		document.removeEventListener( 'keydown', onDocumentKeyDown, false ); | 		document.removeEventListener( 'keydown', onDocumentKeyDown, false ); | ||||||
| 		window.removeEventListener( 'hashchange', onWindowHashChange, false ); | 		window.removeEventListener( 'hashchange', onWindowHashChange, false ); | ||||||
| 		window.removeEventListener( 'resize', onWindowResize, false ); | 		window.removeEventListener( 'resize', onWindowResize, false ); | ||||||
| @@ -1801,7 +1808,7 @@ var Reveal = (function(){ | |||||||
|  |  | ||||||
| 		// TODO There's a bug here where the event listeners are not | 		// TODO There's a bug here where the event listeners are not | ||||||
| 		// removed after deactivating the overview. | 		// removed after deactivating the overview. | ||||||
| 		if( isOverview() ) { | 		if( eventsAreBound && isOverview() ) { | ||||||
| 			event.preventDefault(); | 			event.preventDefault(); | ||||||
|  |  | ||||||
| 			deactivateOverview(); | 			deactivateOverview(); | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								js/reveal.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								js/reveal.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user