|
|
@ -153,13 +153,13 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
this.config = opt.config || {}; |
|
|
this.config = opt.config || {}; |
|
|
this.ccid = Component.createId(this); |
|
|
this.ccid = Component.createId(this); |
|
|
this.set('attributes', this.get('attributes') || {}); |
|
|
this.set('attributes', this.get('attributes') || {}); |
|
|
this.listenTo(this, 'change:script', this.scriptUpdated); |
|
|
|
|
|
this.listenTo(this, 'change:tagName', this.tagUpdated); |
|
|
|
|
|
this.listenTo(this, 'change:attributes', this.attrUpdated); |
|
|
|
|
|
this.initClasses(); |
|
|
this.initClasses(); |
|
|
this.initTraits(); |
|
|
this.initTraits(); |
|
|
this.initComponents(); |
|
|
this.initComponents(); |
|
|
this.initToolbar(); |
|
|
this.initToolbar(); |
|
|
|
|
|
this.listenTo(this, 'change:script', this.scriptUpdated); |
|
|
|
|
|
this.listenTo(this, 'change:tagName', this.tagUpdated); |
|
|
|
|
|
this.listenTo(this, 'change:attributes', this.attrUpdated); |
|
|
this.set('status', ''); |
|
|
this.set('status', ''); |
|
|
|
|
|
|
|
|
// Register global updates for collection properties
|
|
|
// Register global updates for collection properties
|
|
|
@ -356,7 +356,9 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
const id = this.getId(); |
|
|
const id = this.getId(); |
|
|
|
|
|
|
|
|
// Add classes
|
|
|
// Add classes
|
|
|
this.get('classes').each(cls => classes.push(cls.get('name'))); |
|
|
this.get('classes').forEach(cls => |
|
|
|
|
|
classes.push(isString(cls) ? cls : cls.get('name')) |
|
|
|
|
|
); |
|
|
classes.length && (attributes.class = classes.join(' ')); |
|
|
classes.length && (attributes.class = classes.join(' ')); |
|
|
|
|
|
|
|
|
// Check if we need an ID on the component
|
|
|
// Check if we need an ID on the component
|
|
|
|