Override et2_container.destroy() to not try to remove itself from the parent, it does not have a parent

This commit is contained in:
Nathan Gray 2013-02-08 13:25:56 +00:00
parent 763279562c
commit b802aa64a8

View File

@ -287,8 +287,29 @@ var et2_container = et2_baseWidget.extend({
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.setDOMNode(document.createElement("div")); this.setDOMNode(document.createElement("div"));
},
/**
* The destroy function destroys all children of the widget, removes itself
* from the parents children list.
* Overriden to not try to remove self from parent, as that's not possible.
*/
destroy: function() {
// Call the destructor of all children
for (var i = this._children.length - 1; i >= 0; i--)
{
this._children[i].free();
} }
// Free the array managers if they belong to this widget
for (var key in this._mgrs)
{
if (this._mgrs[key] && this._mgrs[key].owner == this)
{
this._mgrs[key].free();
}
}
}
}); });
/** /**