diff --git a/src/editor/config/config.js b/src/editor/config/config.js index 274f10d2b..bc5406979 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -166,7 +166,7 @@ export default { storageManager: {}, //Configurations for Rich Text Editor - rte: {}, + richTextEditor: {}, //Configurations for DomComponents domComponents: {}, diff --git a/src/rich_text_editor/index.js b/src/rich_text_editor/index.js index da0215188..68a44d833 100644 --- a/src/rich_text_editor/index.js +++ b/src/rich_text_editor/index.js @@ -5,7 +5,7 @@ * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/rich_text_editor/config/config.js) * ```js * const editor = grapesjs.init({ - * rte: { + * richTextEditor: { * // options * } * }) @@ -52,20 +52,20 @@ export default () => { */ name: 'RichTextEditor', + getConfig() { + return config; + }, + /** * Initialize module. Automatically called with a new instance of the editor * @param {Object} opts Options * @private */ init(opts = {}) { - config = opts; - - for (let name in defaults) { - if (!(name in config)) { - config[name] = defaults[name]; - } - } - + config = { + ...defaults, + ...opts + }; const ppfx = config.pStylePrefix; if (ppfx) {