aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2016-06-27 11:13:09 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2016-06-27 11:13:09 +0200
commit1da1ff0d6d940832518555716ed4fa3c21c9e69e (patch)
tree7d3a91c5bfe10a13c6dc673a8ed53873173e90cf /js
parent65a90cc75d26be0c1c4c76debf1d6dffb478fc56 (diff)
downloadfosdem-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.js8
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' );