mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 03:24:23 +08:00
added scrollbar support for container DOM, structured the unittests a bit better, and did some minor refactoring
This commit is contained in:
@@ -54,9 +54,10 @@ Kinetic.Container.prototype = {
|
||||
var children = this.children;
|
||||
for(var n = 0; n < children.length; n++) {
|
||||
var child = children[n];
|
||||
if(child.className === "Shape") {
|
||||
if(child.className === 'Shape') {
|
||||
child._draw(child.getLayer());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
child._draw();
|
||||
}
|
||||
}
|
||||
@@ -84,22 +85,22 @@ Kinetic.Container.prototype = {
|
||||
* from the container except the buffer and backstage canvases
|
||||
* and then readd all the layers
|
||||
*/
|
||||
if(this.className === "Stage") {
|
||||
var canvases = this.container.children;
|
||||
if(this.className === 'Stage') {
|
||||
var canvases = this.content.children;
|
||||
var bufferCanvas = canvases[0];
|
||||
var backstageCanvas = canvases[1];
|
||||
|
||||
this.container.innerHTML = "";
|
||||
this.container.appendChild(bufferCanvas);
|
||||
this.container.appendChild(backstageCanvas);
|
||||
this.content.innerHTML = '';
|
||||
this.content.appendChild(bufferCanvas);
|
||||
this.content.appendChild(backstageCanvas);
|
||||
}
|
||||
|
||||
for(var n = 0; n < this.children.length; n++) {
|
||||
this.children[n].index = n;
|
||||
|
||||
if(this.className === "Stage") {
|
||||
this.container.appendChild(this.children[n].canvas);
|
||||
if(this.className === 'Stage') {
|
||||
this.content.appendChild(this.children[n].canvas);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user