replay when auto-slide controls are clicked on last slide

This commit is contained in:
Hakim El Hattab 2013-10-13 17:14:29 -04:00
parent 49cfd05022
commit cfb78d2ee8
2 changed files with 24 additions and 5 deletions

View File

@ -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 ------------------------//

4
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long