add autoSlideStoppable config value, allows autoSlide to be aborted on user input
This commit is contained in:
parent
1421934fde
commit
e94f62a58f
|
@ -97,6 +97,9 @@ Reveal.initialize({
|
|||
// by using a data-autoslide attribute on your slides
|
||||
autoSlide: 0,
|
||||
|
||||
// Stop auto-sliding after user input
|
||||
autoSlideStoppable: true,
|
||||
|
||||
// Enable slide navigation via mouse wheel
|
||||
mouseWheel: false,
|
||||
|
||||
|
|
37
js/reveal.js
37
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.
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue