diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-02-16 19:14:46 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-02-16 19:14:46 +0100 |
commit | c38bc2c611cb2e301599d38445c87b6996184cfe (patch) | |
tree | 432d865d97661c12d6f2171250738ae5c62356d1 /js | |
parent | d2796f56b8561047ba1d8e7ba61117eb2df2ed06 (diff) | |
download | fosdem-2021-minimalism-presentation-c38bc2c611cb2e301599d38445c87b6996184cfe.tar fosdem-2021-minimalism-presentation-c38bc2c611cb2e301599d38445c87b6996184cfe.tar.gz |
fix issue that caused data-auto-animate to be added to the wrong slides
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/js/reveal.js b/js/reveal.js index b9775ae..baf5243 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3067,11 +3067,11 @@ setTimeout( function() { dom.slides.classList.remove( 'disable-slide-transitions' ); }, 0 ); - } - if( config.autoAnimate ) { - // Run the auto-animation between our slides - autoAnimate( previousSlide, currentSlide ); + if( config.autoAnimate ) { + // Run the auto-animation between our slides + autoAnimate( previousSlide, currentSlide ); + } } } @@ -3876,9 +3876,11 @@ } ); - // Set our starting state - fromSlide.dataset.autoAnimate = 'pending'; - toSlide.dataset.autoAnimate = 'pending'; + // Set our starting state. Note that we may be coming from, or + // going to, a non-auto-animate slide so we only want to assign + // this value is the attribute exists. + if( typeof fromSlide.dataset.autoAnimate === 'string' ) fromSlide.dataset.autoAnimate = 'pending'; + if( typeof toSlide.dataset.autoAnimate === 'string' ) toSlide.dataset.autoAnimate = 'pending'; // Inject our auto-animate styles for this transition var css = getAutoAnimatableElements( fromSlide, toSlide ).map( function( elements ) { @@ -3902,7 +3904,7 @@ // Start the animation next cycle setTimeout( function() { - toSlide.dataset.autoAnimate = 'running'; + if( typeof toSlide.dataset.autoAnimate === 'string' ) toSlide.dataset.autoAnimate = 'running'; }, 2 ); } |