mirror of
https://forge.murkfall.net/bluesaxman/librePECS.git
synced 2026-03-13 10:14:20 -06:00
added dialog class and replaced library and options refs with new dialog objects
This commit is contained in:
18
main.js
18
main.js
@@ -1,3 +1,17 @@
|
|||||||
|
// gui object classes?
|
||||||
|
// Why am I doing this?
|
||||||
|
class auxillery_dialog {
|
||||||
|
constructor (title) {
|
||||||
|
this.root = document.createElement("div");
|
||||||
|
this.title = "string" == typeof title ? title : "";
|
||||||
|
var title_bar = document.createElement("div");
|
||||||
|
title_bar.innerText = this.title;
|
||||||
|
this.root.appendChild(title_bar);
|
||||||
|
this.body = document.createElement("div");
|
||||||
|
this.root.appendChild(this.body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize gui
|
// Initialize gui
|
||||||
|
|
||||||
window.app = {};
|
window.app = {};
|
||||||
@@ -12,7 +26,9 @@ app.gui.view = document.createElement("div");
|
|||||||
app.gui.view.id = "view";
|
app.gui.view.id = "view";
|
||||||
app.gui.main.appendChild(app.gui.view);
|
app.gui.main.appendChild(app.gui.view);
|
||||||
// Library popup
|
// Library popup
|
||||||
app.gui.library = document.createElement("dev");
|
app.gui.library = new auxillery_dialog("Library");
|
||||||
|
// Options popup
|
||||||
|
app.gui.options = new auxillery_dialog("Options");
|
||||||
// pre-populate grid with emptys
|
// pre-populate grid with emptys
|
||||||
for (var x = 0; x < 16; x++) {
|
for (var x = 0; x < 16; x++) {
|
||||||
var name = "pec"+x;
|
var name = "pec"+x;
|
||||||
|
|||||||
Reference in New Issue
Block a user