diff --git a/core/deck.core.js b/core/deck.core.js index a8adefe7..b9fee5bc 100644 --- a/core/deck.core.js +++ b/core/deck.core.js @@ -394,6 +394,10 @@ that use the API provided by core. initSlidesArray(options.selectors.slides); // Pre init event for preprocessing hooks beforeInitEvent.done = function() { + // reInitSlidesArray is meant only for beforeInit + methods['reInitSlidesArray'] = function() { + alert('Deck.js method "reInitSlidesArray" is meant to be called in the beforeInit phase only.'); + } // re-populate the array of slides slides = []; initSlidesArray(options.selectors.slides); @@ -427,6 +431,19 @@ that use the API provided by core. }, options.initLockTimeout); }, + /* + jQuery.deck('reInitSlidesArray') + + Force a recomputation of the "slides" array. This method is meant + to be used by extensions that generate new slides in the + beforeInit phase. + */ + + reInitSlidesArray: function() { + slides = []; + initSlidesArray(options.selectors.slides); + }, + /* jQuery.deck('go', index) @@ -601,7 +618,12 @@ that use the API provided by core. return methods[method].apply(this, args); } else { - return methods.init(method, arg); + if (window.defaultDeckCallIsAnError) { + alert("'" + method + "' not found (or meant to be a parameter-less init)"); + } + else { + return methods.init(method, arg); + } } };