diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2015-03-25 14:39:24 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2015-03-25 14:39:24 +0100 |
commit | 2999b628cfe625b1aa9e55d43e185dcef725a42a (patch) | |
tree | b9817df80be2fb76f17181a69f1d662629553834 /js | |
parent | 04283650410045b8003cae6e52e73072e46952a3 (diff) | |
parent | 25c46ccc37f932c04d5c2af7de1d12c6cdaed055 (diff) | |
download | fosdem-2018-presentation-2999b628cfe625b1aa9e55d43e185dcef725a42a.tar fosdem-2018-presentation-2999b628cfe625b1aa9e55d43e185dcef725a42a.tar.gz |
Merge branch 'dev' of https://github.com/bchretien/reveal.js into dev
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/js/reveal.js b/js/reveal.js index 97e61cf..f5ca21f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2476,11 +2476,12 @@ } var totalSlides = getTotalSlides(); + var currentSlide = getSlidePastCount() + 1; dom.slideNumber.innerHTML = format.replace( /h/g, indexh ) .replace( /v/g, indexv ) - .replace( /c/g, Math.round( getProgress() * totalSlides ) + 1 ) - .replace( /t/g, totalSlides + 1 ); + .replace( /c/g, currentSlide ) + .replace( /t/g, totalSlides ); } } @@ -2966,15 +2967,14 @@ } /** - * Returns a value ranging from 0-1 that represents - * how far into the presentation we have navigated. + * Returns the number of past slides. This can be used as a global + * flattened index for slides. */ - function getProgress() { + function getSlidePastCount() { var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); - // The number of past and total slides - var totalCount = getTotalSlides(); + // The number of past slides var pastCount = 0; // Step through all slides and count the past ones @@ -3006,6 +3006,20 @@ } + return pastCount; + + } + + /** + * Returns a value ranging from 0-1 that represents + * how far into the presentation we have navigated. + */ + function getProgress() { + + // The number of past and total slides + var totalCount = getTotalSlides(); + var pastCount = getSlidePastCount(); + if( currentSlide ) { var allFragments = currentSlide.querySelectorAll( '.fragment' ); |