diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-03-05 14:07:59 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-03-05 14:07:59 +0100 |
commit | 4b888d87b7e030f73c20477d103b8b3c7ba6a651 (patch) | |
tree | 123d27998052100b38cb87216fd8d7f3e53d157d | |
parent | 5c24818b7e10831d7af613f55851493c702545c9 (diff) | |
parent | 773b5115a5b221a4b7f559c85d7a1fbaf9c201ae (diff) | |
download | fosdem-2021-minimalism-presentation-4b888d87b7e030f73c20477d103b8b3c7ba6a651.tar fosdem-2021-minimalism-presentation-4b888d87b7e030f73c20477d103b8b3c7ba6a651.tar.gz |
add support for data-visibility='uncounted' #2543
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | js/reveal.js | 12 |
2 files changed, 13 insertions, 4 deletions
@@ -845,6 +845,11 @@ Reveal.addEventListener( 'somestate', function() { }, false ); ``` +### Slide Visibility +When preparing a presentation it can sometimes be helpful to prepare optional slides that you may or may not have time to show. This is easily done by appending a few slides at the end of the presentation, however this means that the reveal.js progress bar and slide numbering will hint that there are additional slides. + +To "hide" those slides from reveal.js' numbering system you can add a `data-visibility` attribute to the slide like so `<section data-visibility="uncounted">`. + ### Slide Backgrounds Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a `data-background` attribute to your `<section>` elements. Four different types of backgrounds are supported: color, image, video and iframe. diff --git a/js/reveal.js b/js/reveal.js index ce3e8a1..2673539 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -4856,7 +4856,10 @@ break mainLoop; } - pastCount++; + // Don't count slides with the "uncounted" class + if( verticalSlides[j].dataset.visibility !== 'uncounted' ) { + pastCount++; + } } @@ -4865,8 +4868,9 @@ break; } - // Don't count the wrapping section for vertical slides - if( horizontalSlide.classList.contains( 'stack' ) === false ) { + // Don't count the wrapping section for vertical slides and + // slides marked as uncounted + if( horizontalSlide.classList.contains( 'stack' ) === false && !horizontalSlide.dataset.visibility !== 'uncounted' ) { pastCount++; } @@ -5078,7 +5082,7 @@ */ function getSlides() { - return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ) ); + return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack):not([data-visibility="uncounted"])' ) ); } |