fixed gub with Container.remove() method which had bad logic removing children nodes

This commit is contained in:
Eric Rowell 2012-07-04 22:04:03 -07:00
parent 26e753b90c
commit d28d2c910d
3 changed files with 6 additions and 10 deletions

View File

@ -1486,10 +1486,8 @@ Kinetic.Container = Kinetic.Node.extend({
this._setChildrenIndices(); this._setChildrenIndices();
// remove children // remove children
if(child.children) { while(child.children && child.children.length > 0) {
for(var n = 0; n < child.children.length; n++) { child.remove(child.children[0]);
child.remove(child.children[n]);
}
} }
// do extra stuff if needed // do extra stuff if needed

File diff suppressed because one or more lines are too long

View File

@ -85,10 +85,8 @@ Kinetic.Container = Kinetic.Node.extend({
this._setChildrenIndices(); this._setChildrenIndices();
// remove children // remove children
if(child.children) { while(child.children && child.children.length > 0) {
for(var n = 0; n < child.children.length; n++) { child.remove(child.children[0]);
child.remove(child.children[n]);
}
} }
// do extra stuff if needed // do extra stuff if needed