aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2017-11-09 10:26:35 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2017-11-09 10:26:35 +0100
commit3beda63a7d749c86085147c800444f929a7a71ea (patch)
tree6486a1e904af56955cb4eaeb8bc3dd47dfd39b09
parent4a4719b5874176907a5ee83221cd9fc17a7a55a5 (diff)
downloadfosdem-2018-presentation-3beda63a7d749c86085147c800444f929a7a71ea.tar
fosdem-2018-presentation-3beda63a7d749c86085147c800444f929a7a71ea.tar.gz
allow to be called directly before or after (closes #2021)
-rw-r--r--js/reveal.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js
index eb9e45d..d5e684a 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -461,6 +461,8 @@
*/
function start() {
+ loaded = true;
+
// Make sure we've got all the DOM elements we need
setupDOM();
@@ -488,8 +490,6 @@
// Enable transitions now that we're loaded
dom.slides.classList.remove( 'no-transition' );
- loaded = true;
-
dom.wrapper.classList.add( 'ready' );
dispatchEvent( 'ready', {
@@ -1014,14 +1014,22 @@
*/
function configure( options ) {
- var numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length;
-
- dom.wrapper.classList.remove( config.transition );
+ var oldTransition = config.transition;
// New config options may be passed when this method
// is invoked through the API after initialization
if( typeof options === 'object' ) extend( config, options );
+ // Abort if reveal.js hasn't finished loading, config
+ // changes will be applied automatically once loading
+ // finishes
+ if( loaded === false ) return;
+
+ var numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length;
+
+ // Remove the previously configured transition class
+ dom.wrapper.classList.remove( oldTransition );
+
// Force linear transition based on browser capabilities
if( features.transforms3d === false ) config.transition = 'linear';