Browse Source

Add `component:selected` event

pull/330/head
Artur Arseniev 9 years ago
parent
commit
be7d243efc
  1. 1
      src/commands/index.js
  2. 1
      src/editor/index.js
  3. 6
      src/editor/model/Editor.js

1
src/commands/index.js

@ -117,7 +117,6 @@ module.exports = () => {
ed.select(null);
sel.destroy();
ed.trigger('change:canvasOffset');
},
};

1
src/editor/index.js

@ -37,6 +37,7 @@
* * `component:update:{propertyName}` - Listen any property change
* * `component:styleUpdate` - Triggered when the style of the component is updated
* * `component:styleUpdate:{propertyName}` - Listen for a specific style property change
* * `component:selected` - New component selected
* * `asset:add` - New asset added
* * `asset:remove` - Asset removed
* * `asset:upload:start` - Before the upload is started

6
src/editor/model/Editor.js

@ -291,10 +291,12 @@ module.exports = Backbone.Model.extend({
* @private
* */
componentSelected(model, val, options) {
if(!this.get('selectedComponent'))
if (!this.get('selectedComponent')) {
this.trigger('deselect-comp');
else
} else {
this.trigger('select-comp',[model,val,options]);
this.trigger('component:selected', arguments);
}
},
/**

Loading…
Cancel
Save