diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2012-09-21 09:27:31 -0400 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2012-09-21 09:27:31 -0400 |
commit | a1e73b78ef6ec05599794e7cfd0b91bd7a10eb88 (patch) | |
tree | 260f75abe0629fa743e68d3fbdbcfa060eb46318 /js/reveal.js | |
parent | edb20515291544f847eab2691d554b5d19662c28 (diff) | |
download | perl-software-in-gnu-guix-a1e73b78ef6ec05599794e7cfd0b91bd7a10eb88.tar perl-software-in-gnu-guix-a1e73b78ef6ec05599794e7cfd0b91bd7a10eb88.tar.gz |
code comments, remove needless nodelist > array conversion
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js index 75525da..78413f3 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -535,11 +535,12 @@ var Reveal = (function(){ */ function activateOverview() { + // Only proceed if enabled in config if( config.overview ) { dom.wrapper.classList.add( 'overview' ); - var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ); for( var i = 0, len1 = horizontalSlides.length; i < len1; i++ ) { var hslide = horizontalSlides[i], @@ -558,7 +559,7 @@ var Reveal = (function(){ hslide.addEventListener( 'click', onOverviewSlideClicked, true ); } - var verticalSlides = Array.prototype.slice.call( hslide.querySelectorAll( 'section' ) ); + var verticalSlides = hslide.querySelectorAll( 'section' ); for( var j = 0, len2 = verticalSlides.length; j < len2; j++ ) { var vslide = verticalSlides[j], @@ -589,10 +590,12 @@ var Reveal = (function(){ */ function deactivateOverview() { + // Only proceed if enabled in config if( config.overview ) { dom.wrapper.classList.remove( 'overview' ); + // Select all slides var slides = Array.prototype.slice.call( document.querySelectorAll( '.reveal .slides section' ) ); for( var i = 0, len = slides.length; i < len; i++ ) { @@ -833,6 +836,7 @@ var Reveal = (function(){ node.classList.remove( 'enabled' ); } ); + // Add the 'enabled' class to the available routes if( routes.left ) dom.controlsLeft.classList.add( 'enabled' ); if( routes.right ) dom.controlsRight.classList.add( 'enabled' ); if( routes.up ) dom.controlsUp.classList.add( 'enabled' ); @@ -985,6 +989,9 @@ var Reveal = (function(){ return false; } + /** + * Cues a new automated slide if enabled in the config. + */ function cueAutoSlide() { clearTimeout( autoSlideTimeout ); |