Browse Source

Update block remove method and set the listener inside the view

pull/236/merge
Artur Arseniev 9 years ago
parent
commit
37126951cc
  1. 5
      src/block_manager/index.js
  2. 2
      src/block_manager/view/BlockView.js

5
src/block_manager/index.js

@ -138,11 +138,10 @@ module.exports = () => {
/**
* Remove block by id
* @param {string} id Block id
* @return {Block} Removed block
*/
remove(id) {
var result = blocks.remove(id);
this.render();
return result;
return blocks.remove(id);
},
};

2
src/block_manager/view/BlockView.js

@ -10,7 +10,7 @@ module.exports = Backbone.View.extend({
_.bindAll(this, 'onDrop');
this.config = config || {};
this.ppfx = this.config.pStylePrefix || '';
this.listenTo(this.model, 'destroy', this.remove);
this.listenTo(this.model, 'destroy remove', this.remove);
this.doc = $(document);
},

Loading…
Cancel
Save