Browse Source

Fix setTarget method in StyleManager. Closes #3081

pull/3092/head
Artur Arseniev 6 years ago
parent
commit
2304c948f5
  1. 2
      src/editor/model/Editor.js
  2. 5
      src/selector_manager/view/ClassTagsView.js
  3. 6
      src/style_manager/view/PropertyView.js
  4. 2
      src/style_manager/view/SectorsView.js

2
src/editor/model/Editor.js

@ -21,8 +21,8 @@ const deps = [
require('storage_manager'),
require('device_manager'),
require('parser'),
require('selector_manager'),
require('style_manager'),
require('selector_manager'),
require('modal_dialog'),
require('code_manager'),
require('panels'),

5
src/selector_manager/view/ClassTagsView.js

@ -64,15 +64,14 @@ export default Backbone.View.extend({
this.stateInputC = this.pfx + 'input-c';
this.states = this.config.states || [];
const { em } = this.config;
const emitter = this.getStyleEmitter();
const coll = this.collection;
this.target = this.config.em;
this.em = em;
const emitter = this.getStyleEmitter();
const toList = 'component:toggled component:update:classes';
const toListCls = 'component:update:classes change:state';
this.listenTo(em, toList, this.componentChanged);
this.listenTo(emitter, 'styleManager:update', this.componentChanged);
this.listenTo(emitter, 'update', this.componentChanged);
this.listenTo(em, toListCls, this.__handleStateChange);
this.listenTo(em, 'styleable:change change:device', this.checkSync); // component:styleUpdate
this.listenTo(coll, 'add', this.addNew);

6
src/style_manager/view/PropertyView.js

@ -77,11 +77,7 @@ export default Backbone.View.extend({
em && em.on(`component:styleUpdate:${property}`, this.targetUpdated);
});
this.listenTo(
this.propTarget,
'update styleManager:update',
this.targetUpdated
);
this.listenTo(this.propTarget, 'update', this.targetUpdated);
this.listenTo(model, 'destroy remove', this.remove);
this.listenTo(model, 'change:value', this.modelValueChanged);
this.listenTo(model, 'targetUpdated', this.targetUpdated);

2
src/style_manager/view/SectorsView.js

@ -149,7 +149,7 @@ export default Backbone.View.extend({
const pt = this.propTarget;
pt.targets = models;
pt.trigger('update');
pt.trigger('update', { targets: models });
return models;
},

Loading…
Cancel
Save