|
|
@ -88,22 +88,20 @@ export default Backbone.View.extend({ |
|
|
onDisable() {}, |
|
|
onDisable() {}, |
|
|
|
|
|
|
|
|
remove() { |
|
|
remove() { |
|
|
const view = this; |
|
|
Backbone.View.prototype.remove.apply(this, arguments); |
|
|
Backbone.View.prototype.remove.apply(view, arguments); |
|
|
const { model, $el } = this; |
|
|
const { model } = view; |
|
|
const { views } = model; |
|
|
const frame = view._getFrame() || {}; |
|
|
const frame = this._getFrame() || {}; |
|
|
const frameM = frame.model; |
|
|
|
|
|
model.components().forEach(comp => { |
|
|
model.components().forEach(comp => { |
|
|
const view = comp.getView(frameM); |
|
|
const view = comp.getView(frame.model); |
|
|
view && view.remove(); |
|
|
view?.remove(); |
|
|
}); |
|
|
}); |
|
|
const cv = view.childrenView; |
|
|
this.childrenView?.remove(); |
|
|
cv && cv.remove(); |
|
|
views.splice(views.indexOf(this), 1); |
|
|
const { views } = model; |
|
|
this.removed(this._clbObj()); |
|
|
views.splice(views.indexOf(view), 1); |
|
|
$el.data({ model: '', collection: '', view: '' }); |
|
|
view.removed(view._clbObj()); |
|
|
// delete model.view; // Sorter relies on this property
|
|
|
view.$el.data({ model: '', collection: '', view: '' }); |
|
|
return this; |
|
|
return view; |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleDragStart(event) { |
|
|
handleDragStart(event) { |
|
|
|