瀏覽代碼

avoid creating duplicate auto-slide controls #770

Hakim El Hattab 11 年之前
父節點
當前提交
26e9ce1ff7
共有 2 個文件被更改,包括 8 次插入6 次删除
  1. 7 5
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 7 - 5
js/reveal.js

@@ -591,7 +591,13 @@ var Reveal = (function(){
 			enablePreviewLinks( '[data-preview-link]' );
 		}
 
-		// Auto-slide playback controls
+		// Remove existing auto-slide controls
+		if( autoSlidePlayer ) {
+			autoSlidePlayer.destroy();
+			autoSlidePlayer = null;
+		}
+
+		// Generate auto-slide controls if needed
 		if( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) {
 			autoSlidePlayer = new Playback( dom.wrapper, function() {
 				return Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );
@@ -600,10 +606,6 @@ var Reveal = (function(){
 			autoSlidePlayer.on( 'click', onAutoSlidePlayerClick );
 			autoSlidePaused = false;
 		}
-		else if( autoSlidePlayer ) {
-			autoSlidePlayer.destroy();
-			autoSlidePlayer = null;
-		}
 
 		// Load the theme in the config, if it's not already loaded
 		if( config.theme && dom.theme ) {

文件差異過大導致無法顯示
+ 1 - 1
js/reveal.min.js


部分文件因文件數量過多而無法顯示