Browse Source

replay when auto-slide controls are clicked on last slide

Hakim El Hattab 11 years ago
parent
commit
cfb78d2ee8
2 changed files with 23 additions and 4 deletions
  1. 22 3
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 22 - 3
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 it is too large
+ 1 - 1
js/reveal.min.js


Some files were not shown because too many files changed in this diff