mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
Merge branch 'master' of github.com:konvajs/konva
This commit is contained in:
commit
c0a3057adb
14
konva.js
14
konva.js
@ -8656,8 +8656,18 @@
|
||||
*/
|
||||
setContainer: function (container) {
|
||||
if (typeof container === STRING) {
|
||||
var id = container;
|
||||
container = Konva.document.getElementById(container);
|
||||
if (container.charAt(0) === '.') {
|
||||
var className = container.slice(1);
|
||||
container = Konva.document.getElementsByClassName(className)[0];
|
||||
} else {
|
||||
var id;
|
||||
if (container.charAt(0) !== '#') {
|
||||
id = container;
|
||||
} else {
|
||||
id = container.slice(1);
|
||||
}
|
||||
container = Konva.document.getElementById(id);
|
||||
}
|
||||
if (!container) {
|
||||
throw 'Can not find container in document with id ' + id;
|
||||
}
|
||||
|
6
konva.min.js
vendored
6
konva.min.js
vendored
File diff suppressed because one or more lines are too long
14
src/Stage.js
14
src/Stage.js
@ -97,8 +97,18 @@
|
||||
*/
|
||||
setContainer: function (container) {
|
||||
if (typeof container === STRING) {
|
||||
var id = container;
|
||||
container = Konva.document.getElementById(container);
|
||||
if (container.charAt(0) === '.') {
|
||||
var className = container.slice(1);
|
||||
container = Konva.document.getElementsByClassName(className)[0];
|
||||
} else {
|
||||
var id;
|
||||
if (container.charAt(0) !== '#') {
|
||||
id = container;
|
||||
} else {
|
||||
id = container.slice(1);
|
||||
}
|
||||
container = Konva.document.getElementById(id);
|
||||
}
|
||||
if (!container) {
|
||||
throw 'Can not find container in document with id ' + id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user