Added function for removing actionObjects

This commit is contained in:
Andreas Stöckel 2011-06-16 17:03:39 +00:00
parent c2e3ddafc1
commit 1706f0fb22

View File

@ -850,6 +850,27 @@ egwActionObject.prototype.clear = function() {
this.focusedChild = null;
}
/**
* Deletes this object from the parent container
*/
egwActionObject.prototype.remove = function() {
// Remove focus and selection from this element
this.setFocused(false);
this.setSelected(false);
this.setAllSelected(false);
// Clear the child-list
this.clear();
// Remove this element from the parent list
if (this.parent != null)
{
var idx = this.parent.children.indexOf(this);
this.parent.children.splice(idx, 1);
}
}
/**
* Searches for the root object in the action object tree and returns it.
*/