replay when auto-slide controls are clicked on last slide
This commit is contained in:
parent
49cfd05022
commit
cfb78d2ee8
25
js/reveal.js
25
js/reveal.js
|
@ -581,9 +581,7 @@ var Reveal = (function(){
|
|||
return Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );
|
||||
} );
|
||||
|
||||
autoSlidePlayer.on( 'click', function() {
|
||||
autoSlidePaused ? resumeAutoSlide() : pauseAutoSlide();
|
||||
} );
|
||||
autoSlidePlayer.on( 'click', onAutoSlidePlayerClick );
|
||||
}
|
||||
else if( autoSlidePlayer ) {
|
||||
autoSlidePlayer.destroy();
|
||||
|
@ -2817,6 +2815,27 @@ var Reveal = (function(){
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles click on the auto-sliding controls element.
|
||||
*/
|
||||
function onAutoSlidePlayerClick( event ) {
|
||||
|
||||
// Replay
|
||||
if( Reveal.isLastSlide() && config.loop === false ) {
|
||||
slide( 0, 0 );
|
||||
resumeAutoSlide();
|
||||
}
|
||||
// Resume
|
||||
else if( autoSlidePaused ) {
|
||||
resumeAutoSlide();
|
||||
}
|
||||
// Pause
|
||||
else {
|
||||
pauseAutoSlide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------//
|
||||
// ------------------------ PLAYBACK COMPONENT ------------------------//
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue