add support for data-visibility='uncounted' #2543

This commit is contained in:
Hakim El Hattab 2020-03-05 14:07:59 +01:00
commit 4b888d87b7
2 changed files with 13 additions and 4 deletions

View file

@ -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.

View file

@ -4856,7 +4856,10 @@
break mainLoop;
}
// 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"])' ) );
}