Skip to content

Commit

Permalink
Remove selectedComponent reference in ClassTagsView
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Jun 2, 2018
1 parent 7fc7a35 commit bbe8bf2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
11 changes: 0 additions & 11 deletions src/dom_components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ module.exports = () => {
c.modal = em.get('Modal') || '';
c.am = em.get('AssetManager') || '';
em.get('Parser').compTypes = componentTypes;
em.on('change:selectedComponent', this.componentChanged, this);
em.on('change:componentHovered', this.componentHovered, this);

const selected = em.get('selected');
Expand Down Expand Up @@ -546,16 +545,6 @@ module.exports = () => {
}
},

/**
* Triggered when the selected component is changed
* @private
*/
componentChanged() {
const em = c.em;
this.selectRemove(em.previous('selectedComponent'));
this.selectAdd(em.get('selectedComponent'));
},

/**
* Triggered when the component is hovered
* @private
Expand Down
2 changes: 1 addition & 1 deletion src/dom_components/model/ComponentVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = Component.extend(
this.set('tagName', 'video');
}
this.loadTraits(traits);
this.em.trigger('change:selectedComponent');
this.em.trigger('component:toggled');
},

// Listen provider change and switch traits, in TraitView listen traits change
Expand Down
8 changes: 2 additions & 6 deletions src/selector_manager/view/ClassTagsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ module.exports = Backbone.View.extend({
this.target = this.config.em;
this.em = this.target;

this.listenTo(
this.target,
'change:selectedComponent',
this.componentChanged
);
this.listenTo(this.target, 'component:toggled', this.componentChanged);
this.listenTo(this.target, 'component:update:classes', this.updateSelector);

this.listenTo(this.collection, 'add', this.addNew);
Expand Down Expand Up @@ -138,7 +134,7 @@ module.exports = Backbone.View.extend({
* @private
*/
componentChanged(e) {
this.compTarget = this.target.get('selectedComponent');
this.compTarget = this.target.getSelected();
const target = this.compTarget;
let validSelectors = [];

Expand Down

0 comments on commit bbe8bf2

Please sign in to comment.