|
|
@ -263,6 +263,19 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
coll.add(this, { at }); |
|
|
coll.add(this, { at }); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Replace a component with another one |
|
|
|
|
|
* @param {String|Component} el Component or HTML string |
|
|
|
|
|
* @return {Array|Component} New added component/s |
|
|
|
|
|
* @private |
|
|
|
|
|
*/ |
|
|
|
|
|
replaceWith(el) { |
|
|
|
|
|
const coll = this.collection; |
|
|
|
|
|
const at = coll.indexOf(this); |
|
|
|
|
|
coll.remove(this); |
|
|
|
|
|
return coll.add(el, { at }); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Emit changes for each updated attribute |
|
|
* Emit changes for each updated attribute |
|
|
*/ |
|
|
*/ |
|
|
|