aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/config.js3
-rw-r--r--js/reveal.js21
2 files changed, 24 insertions, 0 deletions
diff --git a/js/config.js b/js/config.js
index 4d6aa4d..c31c03b 100644
--- a/js/config.js
+++ b/js/config.js
@@ -146,6 +146,9 @@ export default {
// Flags if speaker notes should be visible to all viewers
showNotes: false,
+ // Flags if slides with data-visibility="hidden" should be kep visible
+ showHiddenSlides: false,
+
// Global override for autolaying embedded media (video/audio/iframe)
// - null: Media will only autoplay if data-autoplay is present
// - true: All media will autoplay, regardless of individual setting
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.