|
|
|
@ -162,9 +162,9 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
|
this.set('status', ''); |
|
|
|
|
|
|
|
// Register global updates for collection properties
|
|
|
|
['classes', 'traits'].forEach(name => |
|
|
|
this.listenTo(this.get(name), 'add remove change', () => |
|
|
|
this.emitUpdate(name) |
|
|
|
['classes', 'traits', 'components'].forEach(name => |
|
|
|
this.listenTo(this.get(name), 'add remove change', (...args) => |
|
|
|
this.emitUpdate(name, ...args) |
|
|
|
) |
|
|
|
); |
|
|
|
this.init(); |
|
|
|
@ -877,10 +877,10 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
|
return scr; |
|
|
|
}, |
|
|
|
|
|
|
|
emitUpdate(property) { |
|
|
|
emitUpdate(property, ...args) { |
|
|
|
const em = this.em; |
|
|
|
const event = 'component:update' + (property ? `:${property}` : ''); |
|
|
|
em && em.trigger(event, this); |
|
|
|
em && em.trigger(event, this, ...args); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|