mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
fixed bug with stage.remove(layer). layer canvas context is now correctly removed from the dom
This commit is contained in:
2
dist/kinetic-core.js
vendored
2
dist/kinetic-core.js
vendored
@@ -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) {
|
||||
}
|
||||
|
||||
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
@@ -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
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user