diff options
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/js/reveal.js b/js/reveal.js index 2678e71..1780e71 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -328,7 +328,8 @@ var Reveal = (function(){ } /** - * Applies the configuration settings from the config object. + * Applies the configuration settings from the config + * object. May be called multiple times. */ function configure( options ) { @@ -396,28 +397,7 @@ var Reveal = (function(){ } } - postConfigure(); - - } - - /** - * Updates various parts of the presentatio after the - * configuration has changed. - */ - function postConfigure() { - - // Subscribe to input - removeEventListeners(); - addEventListeners(); - - // Force a layout to make sure the current config is accounted for - layout(); - - // Reflect the current autoSlide value - autoSlide = config.autoSlide; - - // Start auto-sliding if it's enabled - cueAutoSlide(); + sync(); } @@ -1168,6 +1148,28 @@ var Reveal = (function(){ } /** + * Syncs the presentation with the current DOM. Useful + * when new slides or control elements are added or when + * the configuration has changed. + */ + function sync() { + + // Subscribe to input + removeEventListeners(); + addEventListeners(); + + // Force a layout to make sure the current config is accounted for + layout(); + + // Reflect the current autoSlide value + autoSlide = config.autoSlide; + + // Start auto-sliding if it's enabled + cueAutoSlide(); + + } + + /** * Updates one dimension of slides by showing the slide * with the specified index. * @@ -1983,6 +1985,7 @@ var Reveal = (function(){ return { initialize: initialize, configure: configure, + sync: sync, // Navigation methods slide: slide, |