diff --git a/static/js/manual-initializer.js b/static/js/manual-initializer.js index d9bb79f8b..7776ab547 100644 --- a/static/js/manual-initializer.js +++ b/static/js/manual-initializer.js @@ -22,28 +22,14 @@ export default class ManualInitializer { ); }, 5000); window.AnswersExperience.init = (config = {}) => { - this._fireOnDomLoad(() => { - Object.entries(config).forEach(([key, value]) => { - window.AnswersExperience.runtimeConfig.set(key, value); - }); - clearTimeout(runtimeConfigNotProvidedTimeout); - if (!this._hasAnswersInitialized) { - this._initAnswers(); - } - this._hasAnswersInitialized = true; + Object.entries(config).forEach(([key, value]) => { + window.AnswersExperience.runtimeConfig.set(key, value); }); - } - } - - /** - * Executes the provided function on DOM load - * @param {Function} cb - */ - _fireOnDomLoad (cb) { - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', cb); - } else { - cb(); + clearTimeout(runtimeConfigNotProvidedTimeout); + if (!this._hasAnswersInitialized) { + this._initAnswers(); + } + this._hasAnswersInitialized = true; } } } \ No newline at end of file