the paused mode can now be disabled via the 'pause' config option
This commit is contained in:
		
							
								
								
									
										20
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -89,6 +89,9 @@ | |||||||
| 			// key is pressed | 			// key is pressed | ||||||
| 			help: true, | 			help: true, | ||||||
|  |  | ||||||
|  | 			// Flags if it should be possible to pause the presentation (blackout) | ||||||
|  | 			pause: true, | ||||||
|  |  | ||||||
| 			// Number of milliseconds between automatically proceeding to the | 			// Number of milliseconds between automatically proceeding to the | ||||||
| 			// next slide, disabled when set to 0, this value can be overwritten | 			// next slide, disabled when set to 0, this value can be overwritten | ||||||
| 			// by using a data-autoslide attribute on your slides | 			// by using a data-autoslide attribute on your slides | ||||||
| @@ -786,6 +789,11 @@ | |||||||
| 			dom.wrapper.classList.remove( 'center' ); | 			dom.wrapper.classList.remove( 'center' ); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		// Exit the paused mode if it was configured off | ||||||
|  | 		if( config.pause === false ) { | ||||||
|  | 			resume(); | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		if( config.mouseWheel ) { | 		if( config.mouseWheel ) { | ||||||
| 			document.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF | 			document.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF | ||||||
| 			document.addEventListener( 'mousewheel', onDocumentMouseScroll, false ); | 			document.addEventListener( 'mousewheel', onDocumentMouseScroll, false ); | ||||||
| @@ -1717,13 +1725,15 @@ | |||||||
| 	 */ | 	 */ | ||||||
| 	function pause() { | 	function pause() { | ||||||
|  |  | ||||||
| 		var wasPaused = dom.wrapper.classList.contains( 'paused' ); | 		if( config.pause ) { | ||||||
|  | 			var wasPaused = dom.wrapper.classList.contains( 'paused' ); | ||||||
|  |  | ||||||
| 		cancelAutoSlide(); | 			cancelAutoSlide(); | ||||||
| 		dom.wrapper.classList.add( 'paused' ); | 			dom.wrapper.classList.add( 'paused' ); | ||||||
|  |  | ||||||
| 		if( wasPaused === false ) { | 			if( wasPaused === false ) { | ||||||
| 			dispatchEvent( 'paused' ); | 				dispatchEvent( 'paused' ); | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user