瀏覽代碼

don't show auto slide controls if there's only one slide

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

+ 3 - 1
js/reveal.js

@@ -518,6 +518,8 @@ var Reveal = (function(){
 	 */
 	function configure( options ) {
 
+		var numberOfSlides = document.querySelectorAll( SLIDES_SELECTOR ).length;
+
 		dom.wrapper.classList.remove( config.transition );
 
 		// New config options may be passed when this method
@@ -576,7 +578,7 @@ var Reveal = (function(){
 		}
 
 		// Auto-slide playback controls
-		if( config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) {
+		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 );
 			} );

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


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