diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2018-09-08 19:02:32 -0500 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2018-09-08 19:02:32 -0500 |
| commit | 8818ba99f804b1b1845a4757d67cc32d552956e1 (patch) | |
| tree | 06f1f280873d19adf989fdcc9b3c1ab61d640002 /webAO/ui.js | |
| parent | 077fcf719b1a9383b4170f33a77c95024d6f7188 (diff) | |
Continue major cleanup and style fixes
Diffstat (limited to 'webAO/ui.js')
| -rw-r--r-- | webAO/ui.js | 133 |
1 files changed, 61 insertions, 72 deletions
diff --git a/webAO/ui.js b/webAO/ui.js index 557ca4a..4aace2d 100644 --- a/webAO/ui.js +++ b/webAO/ui.js @@ -1,85 +1,74 @@ +/* eslint indent: ["error", 2] */ + import GoldenLayout from "./golden/js/goldenlayout.js"; var config = { - settings: { - showPopoutIcon: false, - showCloseIcon: false - }, - dimensions: { - minItemHeight: 40 - }, + settings: { + showPopoutIcon: false, + showCloseIcon: false + }, + dimensions: { + minItemHeight: 40 + }, + content: [{ + type: "row", content: [{ + type: "column", + width: 40, + content: [{ + type: "component", + componentName: "template", + title: "Game", + componentState: { id: "client_wrapper" } + }] + }, + { + type: "column", + content: [{ type: "row", + height: 65, content: [{ - type: "column", - width: 40, - content: [{ - type: "component", - componentName: "template", - title: "Game", - componentState: { - id: "client_wrapper" - } - }] - }, - { - type: "column", - content: [{ - type: "row", - height: 65, - content: [{ - type: "stack", - content: [{ - type: "component", - title: "Main", - componentName: "template", - componentState: { - id: "mainmenu" - } - }, - { - type: "component", - title: "Log", - componentName: "template", - componentState: { - id: "log" - } - } - ] - }, - { - type: "component", - title: "Music", - width: 30, - componentName: "template", - componentState: { - id: "music" - } - } - ] - }, - { - type: "row", - content: [{ - type: "component", - title: "Server chat", - componentName: "template", - componentState: { - id: "ooc" - } - }] - } - ] - } - ] + type: "stack", + content: [{ + type: "component", + title: "Main", + componentName: "template", + componentState: { id: "mainmenu" } + }, + { + type: "component", + title: "Log", + componentName: "template", + componentState: { id: "log" } + }] + }, + { + type: "component", + title: "Music", + width: 30, + componentName: "template", + componentState: { id: "music" } + }] + }, + { + type: "row", + content: [{ + type: "component", + title: "Server chat", + componentName: "template", + componentState: { id: "ooc" } + }] + }] }] + }] }; var golden = new GoldenLayout(config); golden.registerComponent("template", function (container, componentState) { - let template = document.querySelector(`#${componentState.id}`); - container.getElement().html(template.content); - // TODO: support multiple locales - // container.setTitle(document.querySelector(`#${componentState.id} meta[name='frame-title']`).getAttribute("content")); + let template = document.querySelector(`#${componentState.id}`); + container.getElement().html(template.content); + // TODO: support multiple locales + // container.setTitle(document.querySelector(`#${componentState.id} meta[name='frame-title']`).getAttribute("content")); }); + golden.init();
\ No newline at end of file |
