fixed bug related to multiple removals of same node

This commit is contained in:
Eric Rowell
2012-04-01 10:29:16 -07:00
parent 71b0449071
commit 86a1337017
5 changed files with 114 additions and 19 deletions

View File

@@ -40,12 +40,15 @@ Kinetic.Container.prototype = {
* @param {Node} child
*/
_remove: function(child) {
if(child.name !== undefined) {
this.childrenNames[child.name] = undefined;
if(this.children[child.index].id == child.id) {
if(child.name !== undefined) {
this.childrenNames[child.name] = undefined;
}
this.children.splice(child.index, 1);
this._setChildrenIndices();
child = undefined;
}
this.children.splice(child.index, 1);
this._setChildrenIndices();
child = undefined;
},
/**
* draw children