mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[ts] Better error when parent element is not found.
This commit is contained in:
parent
43acb097e5
commit
1bde7527c9
@ -217,6 +217,7 @@ module spine {
|
||||
|
||||
constructor (parent: HTMLElement | string, private config: SpinePlayerConfig) {
|
||||
this.parent = typeof parent === "string" ? document.getElementById(parent) : parent;
|
||||
if (!this.parent) throw new Error("SpinePlayer parent not found: " + parent);
|
||||
|
||||
if (config.showControls === void 0) config.showControls = true;
|
||||
let controls = config.showControls ? /*html*/`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user