diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-06-02 13:47:34 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-06-02 13:47:34 +0200 |
commit | d272628f5824135a4a571e6c49f5f18e019520cf (patch) | |
tree | bb52d9dafc3ecb518da199c29b40ea44396fd4ae /js/reveal.js | |
parent | c91074761acc91c8d339ac3619f95bcd324bfba4 (diff) | |
download | fosdem-2021-minimalism-presentation-d272628f5824135a4a571e6c49f5f18e019520cf.tar fosdem-2021-minimalism-presentation-d272628f5824135a4a571e6c49f5f18e019520cf.tar.gz |
add support for data-visibility=hidden
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/reveal.js b/js/reveal.js index 44e3d85..e5b4aed 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -174,6 +174,9 @@ export default function( revealElement, options ) { ready = true; + // Remove slides hidden with data-visibility + removeHiddenSlides(); + // Make sure we've got all the DOM elements we need setupDOM(); @@ -232,6 +235,24 @@ export default function( revealElement, options ) { } /** + * Removes all slides with data-visibility="hidden". This + * is done right before the rest of the presentation is + * initialized. + * + * If you want to show all hidden slides, initialize + * reveal.js with showHiddenSlides set to true. + */ + function removeHiddenSlides() { + + if( !config.showHiddenSlides ) { + Util.queryAll( dom.wrapper, 'section[data-visibility="hidden"]' ).forEach( slide => { + slide.parentNode.removeChild( slide ); + } ); + } + + } + + /** * Finds and stores references to DOM elements which are * required by the presentation. If a required element is * not found, it is created. |