|
|
@ -11,18 +11,17 @@ module.exports = Backbone.View.extend({ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Add to collection |
|
|
* Add to collection |
|
|
* @param {Object} Model |
|
|
* @param {Model} model |
|
|
* |
|
|
* @param {Collection} coll |
|
|
* @return void |
|
|
* @param {Object} opts |
|
|
* @private |
|
|
* @private |
|
|
* */ |
|
|
* */ |
|
|
addTo(model) { |
|
|
addTo(model, coll = {}, opts = {}) { |
|
|
const em = this.config.em; |
|
|
const em = this.config.em; |
|
|
const i = this.collection.indexOf(model); |
|
|
const i = this.collection.indexOf(model); |
|
|
this.addToCollection(model, null, i); |
|
|
this.addToCollection(model, null, i); |
|
|
|
|
|
|
|
|
if (em && !model.opt.temporary) { |
|
|
if (em && !opts.temporary) { |
|
|
em.trigger('add:component', model); // @deprecated
|
|
|
|
|
|
em.trigger('component:add', model); |
|
|
em.trigger('component:add', model); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|