removeChildren now removes all descendants. returned this for all applicable methods in Node, Layer, Stage, and Shape

This commit is contained in:
Eric Rowell
2013-06-06 22:45:31 -07:00
parent 824e9fdbee
commit ffc33a7676
6 changed files with 101 additions and 6 deletions

View File

@@ -317,6 +317,7 @@ Test.Modules.CONTAINER = {
height: 200
});
var layer = new Kinetic.Layer();
var group = new Kinetic.Group();
var circle1 = new Kinetic.Circle({
x: 100,
y: stage.getHeight() / 2,
@@ -335,16 +336,19 @@ Test.Modules.CONTAINER = {
strokeWidth: 4
});
layer.add(circle1);
layer.add(circle2);
group.add(circle1);
group.add(circle2);
layer.add(group);
stage.add(layer);
test(layer.children.length === 2, 'layer should have 2 children');
test(layer.children.length === 1, 'layer should have 1 children');
test(group.children.length === 2, 'group should have 2 children');
layer.removeChildren();
layer.draw();
test(layer.children.length === 0, 'layer should have 0 children');
test(group.children.length === 0, 'group should have 0 children');
},
'add group': function(containerId) {
var stage = new Kinetic.Stage({
@@ -1098,6 +1102,7 @@ Test.Modules.CONTAINER = {
layer.add(bluecircle);
stage.add(layer);
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
layer.moveDown();