aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab2013-10-13 17:14:29 -0400
committerHakim El Hattab2013-10-13 17:14:29 -0400
commitcfb78d2ee812417cce384fe6796bd3ae47ca4876 (patch)
tree5c21334ddf4357575b5707f67eccc53a2be8051e /js/reveal.js
parent49cfd05022b42041dd15d30e119c3a7fdcc5e88d (diff)
replay when auto-slide controls are clicked on last slide
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js25
1 files changed, 22 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 3d9bcf7..777f4ab 100644
--- a/js/reveal.js
+++ b/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 ------------------------//