|
@@ -51,6 +51,9 @@ export default function( revealElement, options ) {
|
|
// Configuration defaults, can be overridden at initialization time
|
|
// Configuration defaults, can be overridden at initialization time
|
|
let config = {},
|
|
let config = {},
|
|
|
|
|
|
|
|
+ // Flags if initialize() has been invoked for this reveal instance
|
|
|
|
+ initialized = false,
|
|
|
|
+
|
|
// Flags if reveal.js is loaded (has dispatched the 'ready' event)
|
|
// Flags if reveal.js is loaded (has dispatched the 'ready' event)
|
|
ready = false,
|
|
ready = false,
|
|
|
|
|
|
@@ -127,6 +130,8 @@ export default function( revealElement, options ) {
|
|
|
|
|
|
if( !revealElement ) throw 'Unable to find presentation root (<div class="reveal">).';
|
|
if( !revealElement ) throw 'Unable to find presentation root (<div class="reveal">).';
|
|
|
|
|
|
|
|
+ initialized = true;
|
|
|
|
+
|
|
// Cache references to key DOM elements
|
|
// Cache references to key DOM elements
|
|
dom.wrapper = revealElement;
|
|
dom.wrapper = revealElement;
|
|
dom.slides = revealElement.querySelector( '.slides' );
|
|
dom.slides = revealElement.querySelector( '.slides' );
|
|
@@ -604,6 +609,10 @@ export default function( revealElement, options ) {
|
|
*/
|
|
*/
|
|
function destroy() {
|
|
function destroy() {
|
|
|
|
|
|
|
|
+ // There's nothing to destroy if this instance hasn't been
|
|
|
|
+ // initialized yet
|
|
|
|
+ if( initialized === false ) return;
|
|
|
|
+
|
|
removeEventListeners();
|
|
removeEventListeners();
|
|
cancelAutoSlide();
|
|
cancelAutoSlide();
|
|
disablePreviewLinks();
|
|
disablePreviewLinks();
|