diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-03-12 19:11:19 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-03-12 19:11:19 +0100 |
commit | 4f280f77b06418812aed7e8cae60396b04fce733 (patch) | |
tree | c7b574b2ab45136a44cdb013d5e70d1d3bcc1346 /js/reveal.js | |
parent | bff9bfb101763ed960cb8e5de7152da8d366f2af (diff) | |
download | fosdem-2021-minimalism-presentation-4f280f77b06418812aed7e8cae60396b04fce733.tar fosdem-2021-minimalism-presentation-4f280f77b06418812aed7e8cae60396b04fce733.tar.gz |
update logic for disabling fragments via config option
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js index 2ece961..1768521 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -787,7 +787,7 @@ export default function( revealElement, options ) { */ function configure( options ) { - const oldTransition = config.transition; + const oldConfig = { ...config } // New config options may be passed when this method // is invoked through the API after initialization @@ -800,7 +800,7 @@ export default function( revealElement, options ) { const numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length; // The transition is added as a class on the .reveal element - dom.wrapper.classList.remove( oldTransition ); + dom.wrapper.classList.remove( oldConfig.transition ); dom.wrapper.classList.add( config.transition ); dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed ); @@ -889,9 +889,12 @@ export default function( revealElement, options ) { autoSlidePaused = false; } - // When fragments are turned off they should be visible + // Update the state of our fragments if( config.fragments === false ) { - fragments.showAll(); + fragments.disable(); + } + else if( oldConfig.fragments === false ) { + fragments.enable(); } // Add the navigation mode to the DOM so we can adjust styling |