diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-09-06 08:20:38 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-09-06 08:20:38 +0200 |
commit | cbef64b860e75e010a383543de3c5f478fc4227a (patch) | |
tree | 2afb8f9da963afe49358950a0ef975176a00c934 /js | |
parent | 2cd988a7a347ddad39b4315b2f63e7c1105ecd19 (diff) | |
download | perl-software-in-gnu-guix-cbef64b860e75e010a383543de3c5f478fc4227a.tar perl-software-in-gnu-guix-cbef64b860e75e010a383543de3c5f478fc4227a.tar.gz |
fix current fragment index check when multiple fragments have same index
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js index 25f0dcf..e756110 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2871,8 +2871,13 @@ if( !slide && currentSlide ) { var hasFragments = currentSlide.querySelectorAll( '.fragment' ).length > 0; if( hasFragments ) { - var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' ); - f = visibleFragments.length - 1; + var currentFragment = currentSlide.querySelector( '.current-fragment' ); + if( currentFragment && currentFragment.hasAttribute( 'data-fragment-index' ) ) { + f = parseInt( currentFragment.getAttribute( 'data-fragment-index' ), 10 ); + } + else { + f = currentSlide.querySelectorAll( '.fragment.visible' ).length - 1; + } } } |