Skip to content

Commit

Permalink
the paused mode can now be disabled via the 'pause' config option
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Aug 12, 2014
1 parent 841f9d0 commit 80c375f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
// key is pressed
help: true,

// Flags if it should be possible to pause the presentation (blackout)
pause: true,

// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
Expand Down Expand Up @@ -786,6 +789,11 @@
dom.wrapper.classList.remove( 'center' );
}

// Exit the paused mode if it was configured off
if( config.pause === false ) {
resume();
}

if( config.mouseWheel ) {
document.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF
document.addEventListener( 'mousewheel', onDocumentMouseScroll, false );
Expand Down Expand Up @@ -1717,13 +1725,15 @@
*/
function pause() {

var wasPaused = dom.wrapper.classList.contains( 'paused' );
if( config.pause ) {
var wasPaused = dom.wrapper.classList.contains( 'paused' );

cancelAutoSlide();
dom.wrapper.classList.add( 'paused' );
cancelAutoSlide();
dom.wrapper.classList.add( 'paused' );

if( wasPaused === false ) {
dispatchEvent( 'paused' );
if( wasPaused === false ) {
dispatchEvent( 'paused' );
}
}

}
Expand Down

0 comments on commit 80c375f

Please sign in to comment.