mirror of
https://github.com/konvajs/konva.git
synced 2025-04-30 00:29:50 +08:00
fixed gub with Container.remove() method which had bad logic removing children nodes
This commit is contained in:
parent
26e753b90c
commit
d28d2c910d
6
dist/kinetic-core.js
vendored
6
dist/kinetic-core.js
vendored
@ -1486,10 +1486,8 @@ Kinetic.Container = Kinetic.Node.extend({
|
||||
this._setChildrenIndices();
|
||||
|
||||
// remove children
|
||||
if(child.children) {
|
||||
for(var n = 0; n < child.children.length; n++) {
|
||||
child.remove(child.children[n]);
|
||||
}
|
||||
while(child.children && child.children.length > 0) {
|
||||
child.remove(child.children[0]);
|
||||
}
|
||||
|
||||
// do extra stuff if needed
|
||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -85,10 +85,8 @@ Kinetic.Container = Kinetic.Node.extend({
|
||||
this._setChildrenIndices();
|
||||
|
||||
// remove children
|
||||
if(child.children) {
|
||||
for(var n = 0; n < child.children.length; n++) {
|
||||
child.remove(child.children[n]);
|
||||
}
|
||||
while(child.children && child.children.length > 0) {
|
||||
child.remove(child.children[0]);
|
||||
}
|
||||
|
||||
// do extra stuff if needed
|
||||
|
Loading…
Reference in New Issue
Block a user