Browse Source

Avoid `component:add` with temporary adds

pull/540/head
Artur Arseniev 9 years ago
parent
commit
c2add4a092
  1. 9
      src/dom_components/view/ComponentsView.js
  2. 2
      src/keymaps/index.js

9
src/dom_components/view/ComponentsView.js

@ -18,13 +18,12 @@ module.exports = Backbone.View.extend({
* @private
* */
addTo(model) {
var i = this.collection.indexOf(model);
const em = this.config.em;
const i = this.collection.indexOf(model);
this.addToCollection(model, null, i);
var em = this.config.em;
if(em) {
// OLD
em.trigger('add:component', model);
if (em && !model.opt.temporary) {
em.trigger('add:component', model); // @deprecated
em.trigger('component:add', model);
}
},

2
src/keymaps/index.js

@ -7,7 +7,7 @@
* ```
*
*/
import { defaults, isString } from 'underscore';
import { isString } from 'underscore';
const keymaster = require('keymaster');

Loading…
Cancel
Save