Skip to content

Commit 8446ede

Browse files
committed
Fixed the moveToTop and moveToBottom functions (thanks Lamberto!)
1 parent 12f5597 commit 8446ede

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderable/container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
var childIndex = this.getChildIndex(child);
469469
if (childIndex > 0) {
470470
// note : we use an inverted loop
471-
this.splice(0, 0, this.splice(childIndex, 1)[0]);
471+
this.children.splice(0, 0, this.children.splice(childIndex, 1)[0]);
472472
// increment our child z value based on the previous child depth
473473
child.z = this.children[1].z + 1;
474474
}
@@ -485,7 +485,7 @@
485485
var childIndex = this.getChildIndex(child);
486486
if (childIndex < (this.children.length - 1)) {
487487
// note : we use an inverted loop
488-
this.splice((this.children.length - 1), 0, this.splice(childIndex, 1)[0]);
488+
this.children.splice((this.children.length - 1), 0, this.children.splice(childIndex, 1)[0]);
489489
// increment our child z value based on the next child depth
490490
child.z = this.children[(this.children.length - 2)].z - 1;
491491
}

0 commit comments

Comments
 (0)