diff options
| author | caleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu> | 2022-03-18 11:45:49 -0400 |
|---|---|---|
| committer | caleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu> | 2022-03-18 11:45:49 -0400 |
| commit | f3726b0b4c6bc6044ffdce39fdbd82318ff37512 (patch) | |
| tree | 840803d5efd9c3126757e555437ee7f3af433667 | |
| parent | cd20fe050d256d55f7b7fc6bf53ca4db6ccf93a0 (diff) | |
Update golden-layout to support v2
| -rw-r--r-- | webAO/ui.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/webAO/ui.js b/webAO/ui.js index 9e95be9..0baad1d 100644 --- a/webAO/ui.js +++ b/webAO/ui.js @@ -1,7 +1,6 @@ /* eslint indent: ["error", 2] */ -// import GoldenLayout from "./golden/js/goldenlayout.js"; -import GoldenLayout from 'golden-layout'; +import { GoldenLayout } from "golden-layout"; const config = { settings: { @@ -67,12 +66,12 @@ const config = { }], }; -const golden = new GoldenLayout(config); -golden.registerComponent('template', (container, componentState) => { +const golden = new GoldenLayout(); +golden.registerComponentFactoryFunction('template', (container, componentState) => { const template = document.querySelector(`#${componentState.id}`); - container.getElement().html(template.content); + container.element.innerHTML = template.innerHTML; // TODO: support multiple locales // container.setTitle(document.querySelector(`#${componentState.id} meta[name='frame-title']`).getAttribute("content")); }); +golden.loadLayout(config) -golden.init(); |
