diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2013-08-26 09:20:12 -0400 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2013-08-26 09:20:12 -0400 |
commit | e9b0f5b4818064f3295cf8cf2f3a0b6575302714 (patch) | |
tree | e180378535d4510dfe5e82f54b8de65c3a141bc6 /js/reveal.js | |
parent | cf8b00405280c9e25b7807d20d657160654e0b53 (diff) | |
download | fosdem-2018-presentation-e9b0f5b4818064f3295cf8cf2f3a0b6575302714.tar fosdem-2018-presentation-e9b0f5b4818064f3295cf8cf2f3a0b6575302714.tar.gz |
minor refactoring of overview code
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/js/reveal.js b/js/reveal.js index c7860ad..c0d8ce9 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1156,7 +1156,7 @@ var Reveal = (function(){ var depth = window.innerWidth < 400 ? 1000 : 2500; dom.wrapper.classList.add( 'overview' ); - dom.wrapper.classList.remove( 'exit-overview' ); + dom.wrapper.classList.remove( 'overview-deactivating' ); clearTimeout( activateOverviewTimeout ); clearTimeout( deactivateOverviewTimeout ); @@ -1164,7 +1164,7 @@ var Reveal = (function(){ // Not the pretties solution, but need to let the overview // class apply first so that slides are measured accurately // before we can position them - activateOverviewTimeout = setTimeout( function(){ + activateOverviewTimeout = setTimeout( function() { var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ); @@ -1241,25 +1241,19 @@ var Reveal = (function(){ // Temporarily add a class so that transitions can do different things // depending on whether they are exiting/entering overview, or just // moving from slide to slide - dom.wrapper.classList.add( 'exit-overview' ); + dom.wrapper.classList.add( 'overview-deactivating' ); deactivateOverviewTimeout = setTimeout( function () { - dom.wrapper.classList.remove( 'exit-overview' ); - }, 10); + dom.wrapper.classList.remove( 'overview-deactivating' ); + }, 1 ); // Select all slides - var slides = toArray( document.querySelectorAll( SLIDES_SELECTOR ) ); - - for( var i = 0, len = slides.length; i < len; i++ ) { - var element = slides[i]; - - element.style.display = ''; - + toArray( document.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { // Resets all transforms to use the external styles - transformElement( element, '' ); + transformElement( slide, '' ); - element.removeEventListener( 'click', onOverviewSlideClicked, true ); - } + slide.removeEventListener( 'click', onOverviewSlideClicked, true ); + } ); slide( indexh, indexv ); |