Browse Source

Remove `updateComponents` method from Editor

pull/663/head
Artur Arseniev 8 years ago
parent
commit
4ef8882eee
  1. 33
      src/editor/model/Editor.js

33
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

Loading…
Cancel
Save