From dd08b86a0fbc330ba7c8631bc630bda3f7d9982b Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 17 Oct 2013 22:27:31 -0400 Subject: don't show auto slide controls if there's only one slide --- js/reveal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/reveal.js') diff --git a/js/reveal.js b/js/reveal.js index 9ac7a45..de254d4 100644 --- a/js/reveal.js +++ b/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 ); } ); -- cgit v1.2.3