Merge branch 'master' of github.com:konvajs/konva

This commit is contained in:
Anton Lavrenov 2016-02-28 17:05:11 +08:00
commit c0a3057adb
3 changed files with 31 additions and 11 deletions

View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -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;
}