From 6046e638afb8bddbd01b8731368255dd7487c746 Mon Sep 17 00:00:00 2001 From: Arthur Almeida Date: Sat, 30 Sep 2017 12:13:31 -0300 Subject: [PATCH] moved module initialization before plugin initialization --- src/grapesjs/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/grapesjs/index.js b/src/grapesjs/index.js index 8fb20022e..ce4e4800a 100644 --- a/src/grapesjs/index.js +++ b/src/grapesjs/index.js @@ -50,6 +50,11 @@ module.exports = (() => { config.el = els instanceof window.HTMLElement ? els : document.querySelector(els); const editor = new Editor(config).init(); + // Execute `onLoad` on modules once all plugins are initialized. + // A plugin might have extended/added some custom type so this + // is a good point to load stuff like components, css rules, etc. + editor.getModel().loadOnStart(); + // Load plugins config.plugins.forEach(pluginId => { const plugin = plugins.get(pluginId); @@ -61,11 +66,6 @@ module.exports = (() => { } }); - // Execute `onLoad` on modules once all plugins are initialized. - // A plugin might have extended/added some custom type so this - // is a good point to load stuff like components, css rules, etc. - editor.getModel().loadOnStart(); - config.autorender && editor.render(); editors.push(editor);