From 2304c948f53b75b9173f68300d95d0de26fe67af Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 23 Oct 2020 03:54:17 +0200 Subject: [PATCH] Fix setTarget method in StyleManager. Closes #3081 --- src/editor/model/Editor.js | 2 +- src/selector_manager/view/ClassTagsView.js | 5 ++--- src/style_manager/view/PropertyView.js | 6 +----- src/style_manager/view/SectorsView.js | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 37db7cd95..f49a642bd 100644 --- a/src/editor/model/Editor.js +++ b/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'), diff --git a/src/selector_manager/view/ClassTagsView.js b/src/selector_manager/view/ClassTagsView.js index ede1f3198..c5d6e59c8 100644 --- a/src/selector_manager/view/ClassTagsView.js +++ b/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); diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index bda17eb1b..e1908d878 100644 --- a/src/style_manager/view/PropertyView.js +++ b/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); diff --git a/src/style_manager/view/SectorsView.js b/src/style_manager/view/SectorsView.js index a3a62835a..4437ad034 100644 --- a/src/style_manager/view/SectorsView.js +++ b/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; },