Browse Source

Update docs for richTextEditor config. Closes #2241

pull/2253/head
Artur Arseniev 7 years ago
parent
commit
6e7a38140f
  1. 2
      src/editor/config/config.js
  2. 18
      src/rich_text_editor/index.js

2
src/editor/config/config.js

@ -166,7 +166,7 @@ export default {
storageManager: {}, storageManager: {},
//Configurations for Rich Text Editor //Configurations for Rich Text Editor
rte: {}, richTextEditor: {},
//Configurations for DomComponents //Configurations for DomComponents
domComponents: {}, domComponents: {},

18
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) * 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 * ```js
* const editor = grapesjs.init({ * const editor = grapesjs.init({
* rte: { * richTextEditor: {
* // options * // options
* } * }
* }) * })
@ -52,20 +52,20 @@ export default () => {
*/ */
name: 'RichTextEditor', name: 'RichTextEditor',
getConfig() {
return config;
},
/** /**
* Initialize module. Automatically called with a new instance of the editor * Initialize module. Automatically called with a new instance of the editor
* @param {Object} opts Options * @param {Object} opts Options
* @private * @private
*/ */
init(opts = {}) { init(opts = {}) {
config = opts; config = {
...defaults,
for (let name in defaults) { ...opts
if (!(name in config)) { };
config[name] = defaults[name];
}
}
const ppfx = config.pStylePrefix; const ppfx = config.pStylePrefix;
if (ppfx) { if (ppfx) {

Loading…
Cancel
Save