From 6c77d85c762281bb9756d4b0dd1111dd2b8026a7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Nov 2017 01:36:10 +0100 Subject: [PATCH] Minor update in `loadModule` --- src/editor/model/Editor.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 4ba4bf7d7..93f88a64c 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -144,30 +144,30 @@ module.exports = Backbone.Model.extend({ */ loadModule(moduleName) { var c = this.config; - var M = new moduleName(); - var name = M.name.charAt(0).toLowerCase() + M.name.slice(1); - var cfg = c[name] || c[M.name] || {}; + var Mod = new moduleName(); + var name = Mod.name.charAt(0).toLowerCase() + Mod.name.slice(1); + var cfg = c[name] || c[Mod.name] || {}; cfg.pStylePrefix = c.pStylePrefix || ''; // Check if module is storable var sm = this.get('StorageManager'); - if(M.storageKey && M.store && M.load && sm){ + if(Mod.storageKey && Mod.store && Mod.load && sm){ cfg.stm = sm; var storables = this.get('storables'); - storables.push(M); + storables.push(Mod); this.set('storables', storables); } cfg.em = this; - M.init(Object.create(cfg)); + Mod.init({ ...cfg }); // Bind the module to the editor model if public - if(!M.private) - this.set(M.name, M); + if(!Mod.private) + this.set(Mod.name, Mod); - if(M.onLoad) - this.get('toLoad').push(M); + if(Mod.onLoad) + this.get('toLoad').push(Mod); - this.get('modules').push(M); + this.get('modules').push(Mod); return this; },