Browse Source

moved module initialization before plugin initialization

pull/356/head
Arthur Almeida 8 years ago
parent
commit
6046e638af
  1. 10
      src/grapesjs/index.js

10
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);

Loading…
Cancel
Save