Browse Source

Update ComponentDelete command

pull/2524/head
Artur Arseniev 7 years ago
parent
commit
cc955f22b4
  1. 11
      src/commands/view/ComponentDelete.js

11
src/commands/view/ComponentDelete.js

@ -11,14 +11,11 @@ export default {
components.forEach(component => {
if (!component || !component.get('removable')) {
console.warn('The element is not removable', component);
return;
}
if (component) {
const coll = component.collection;
component.trigger('component:destroy');
coll && coll.remove(component);
return this.em.logWarning('The element is not removable', {
component
});
}
component.remove();
});
return components;

Loading…
Cancel
Save