From 4ef8882eee569e9f08e6f4e6d10e8411d62f0cf9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 11 Dec 2017 01:10:21 +0100 Subject: [PATCH] Remove `updateComponents` method from Editor --- src/editor/model/Editor.js | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 69014dcb8..4c6636504 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -321,39 +321,6 @@ module.exports = Backbone.Model.extend({ } }, - /** - * Triggered when components are updated - * @param {Object} model - * @param {Mixed} val Value - * @param {Object} opt Options - * @private - * */ - updateComponents(model, val, opt) { - var comps = model.get('components'), - classes = model.get('classes'), - avSt = opt ? opt.avoidStore : 0; - - // Observe component with Undo Manager - if(this.um) - this.um.register(comps); - - // Call stopListening for not creating nested listeners - this.stopListening(comps, 'add', this.updateComponents); - this.stopListening(comps, 'remove', this.rmComponents); - this.listenTo(comps, 'add', this.updateComponents); - this.listenTo(comps, 'remove', this.rmComponents); - - this.stopListening(classes, 'add remove', this.handleUpdates); - this.listenTo(classes, 'add remove', this.handleUpdates); - - var evn = 'change:style change:content change:attributes change:src'; - this.stopListening(model, evn, this.handleUpdates); - this.listenTo(model, evn, this.handleUpdates); - - if(!avSt) - this.handleUpdates(model, val, opt); - }, - /** * Returns model of the selected component