diff options
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/js/reveal.js b/js/reveal.js index e6368d6..9c798f4 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -68,6 +68,9 @@ var Reveal = (function(){ // by using a data-autoslide attribute on your slides autoSlide: 0, + // Stop auto-sliding after user input + autoSlideStoppable: false, + // Enable slide navigation via mouse wheel mouseWheel: false, @@ -2349,11 +2352,21 @@ var Reveal = (function(){ // ----------------------------- EVENTS -------------------------------// // --------------------------------------------------------------------// + /** + * Called by all event handlers that are based on user + * input. + */ + function onUserInput( event ) { + + if( config.autoSlideStoppable ) { + config.autoSlide = 0; + cancelAutoSlide(); + } + + } /** * Handler for the document level 'keydown' event. - * - * @param {Object} event */ function onDocumentKeyDown( event ) { @@ -2453,6 +2466,8 @@ var Reveal = (function(){ // another timeout cueAutoSlide(); + onUserInput( event ); + } /** @@ -2477,6 +2492,8 @@ var Reveal = (function(){ } ); } + onUserInput( event ); + } /** @@ -2583,6 +2600,8 @@ var Reveal = (function(){ onTouchStart( event ); } + onUserInput( event ); + } /** @@ -2646,17 +2665,19 @@ var Reveal = (function(){ slide( slideIndex ); + onUserInput( event ); + } /** * Event handler for navigation control buttons. */ - function onNavigateLeftClicked( event ) { event.preventDefault(); navigateLeft(); } - function onNavigateRightClicked( event ) { event.preventDefault(); navigateRight(); } - function onNavigateUpClicked( event ) { event.preventDefault(); navigateUp(); } - function onNavigateDownClicked( event ) { event.preventDefault(); navigateDown(); } - function onNavigatePrevClicked( event ) { event.preventDefault(); navigatePrev(); } - function onNavigateNextClicked( event ) { event.preventDefault(); navigateNext(); } + function onNavigateLeftClicked( event ) { event.preventDefault(); navigateLeft(); onUserInput(); } + function onNavigateRightClicked( event ) { event.preventDefault(); navigateRight(); onUserInput(); } + function onNavigateUpClicked( event ) { event.preventDefault(); navigateUp(); onUserInput(); } + function onNavigateDownClicked( event ) { event.preventDefault(); navigateDown(); onUserInput(); } + function onNavigatePrevClicked( event ) { event.preventDefault(); navigatePrev(); onUserInput(); } + function onNavigateNextClicked( event ) { event.preventDefault(); navigateNext(); onUserInput(); } /** * Handler for the window level 'hashchange' event. |