fixed bug with stage.remove(layer). layer canvas context is now correctly removed from the dom

This commit is contained in:
Eric Rowell
2012-07-28 22:16:29 -07:00
parent e69c7a9ac1
commit 87182d704c
5 changed files with 10 additions and 5 deletions

View File

@@ -3125,7 +3125,7 @@ Kinetic.Stage = Kinetic.Container.extend({
* it exists
*/
try {
this.content.removeChild(layer.canvas);
this.content.removeChild(layer.canvas.element);
}
catch(e) {
}

File diff suppressed because one or more lines are too long

View File

@@ -407,7 +407,7 @@ Kinetic.Stage = Kinetic.Container.extend({
* it exists
*/
try {
this.content.removeChild(layer.canvas);
this.content.removeChild(layer.canvas.element);
}
catch(e) {
}

File diff suppressed because one or more lines are too long

View File

@@ -749,7 +749,7 @@ Test.prototype.tests = {
test(go.tempNodes.length === 0, 'shouldn\'t be nodes in the tempNdoes array');
},
'STAGE - remove layer with shape': function(containerId) {
'CONTAINER - remove layer with shape': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
@@ -780,6 +780,8 @@ Test.prototype.tests = {
test(stage.children.length === 0, 'stage should have 0 children');
test(stage.get('.myLayer')[0] === undefined, 'layer should not exist');
test(stage.get('.myCircle')[0] === undefined, 'circle should not exist');
stage.draw();
},
'STAGE - remove layer with no shapes': function(containerId) {
var stage = new Kinetic.Stage({