diff options
author | Hakim El Hattab | 2013-02-09 19:04:17 -0500 |
---|---|---|
committer | Hakim El Hattab | 2013-02-09 19:04:17 -0500 |
commit | 2962325fd1e5c7a1fe723a7eea8534ed1626bc6c (patch) | |
tree | 3621cf91bf5f3d74c192a904ed3722953d33e99f /js/reveal.js | |
parent | 380264afc8468544d82f3e50115cef249f08fff5 (diff) |
stop auto-slide on pause and overview (closes #320)
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js index d97d77a..dd23d99 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -675,6 +675,9 @@ var Reveal = (function(){ // Only proceed if enabled in config if( config.overview ) { + // Don't auto-slide while in overview mode + cancelAutoSlide(); + var wasActive = dom.wrapper.classList.contains( 'overview' ); dom.wrapper.classList.add( 'overview' ); @@ -794,6 +797,8 @@ var Reveal = (function(){ slide( indexh, indexv ); + cueAutoSlide(); + // Notify observers of the overview hiding dispatchEvent( 'overviewhidden', { 'indexh': indexh, @@ -862,6 +867,7 @@ var Reveal = (function(){ */ function pause() { + cancelAutoSlide(); dom.wrapper.classList.add( 'paused' ); } @@ -871,6 +877,7 @@ var Reveal = (function(){ */ function resume() { + cueAutoSlide(); dom.wrapper.classList.remove( 'paused' ); } @@ -1424,12 +1431,21 @@ var Reveal = (function(){ clearTimeout( autoSlideTimeout ); // Cue the next auto-slide if enabled - if( autoSlide ) { + if( autoSlide && !isPaused() && !isOverviewActive() ) { autoSlideTimeout = setTimeout( navigateNext, autoSlide ); } } + /** + * Cancels any ongoing request to auto-slide. + */ + function cancelAutoSlide() { + + clearTimeout( autoSlideTimeout ); + + } + function navigateLeft() { // Prioritize hiding fragments |