diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2016-06-27 11:13:09 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2016-06-27 11:13:09 +0200 |
commit | 1da1ff0d6d940832518555716ed4fa3c21c9e69e (patch) | |
tree | 7d3a91c5bfe10a13c6dc673a8ed53873173e90cf /js | |
parent | 65a90cc75d26be0c1c4c76debf1d6dffb478fc56 (diff) | |
download | fosdem-2018-presentation-1da1ff0d6d940832518555716ed4fa3c21c9e69e.tar fosdem-2018-presentation-1da1ff0d6d940832518555716ed4fa3c21c9e69e.tar.gz |
use first fragment's data-autoslide value when there is no current fragment
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js index 1624b79..3f003d9 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3682,9 +3682,13 @@ if( currentSlide ) { - var currentFragment = currentSlide.querySelector( '.current-fragment' ); + var fragment = currentSlide.querySelector( '.current-fragment' ); - var fragmentAutoSlide = currentFragment ? currentFragment.getAttribute( 'data-autoslide' ) : null; + // When the slide first appears there is no "current" fragment so + // we look for a data-autoslide timing on the first fragment + if( !fragment ) fragment = currentSlide.querySelector( '.fragment' ); + + var fragmentAutoSlide = fragment ? fragment.getAttribute( 'data-autoslide' ) : null; var parentAutoSlide = currentSlide.parentNode ? currentSlide.parentNode.getAttribute( 'data-autoslide' ) : null; var slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' ); |