Split JS into per-class files Cut parts of trweb class out Move init code from event handler to constructor
20 lines
429 B
JavaScript
20 lines
429 B
JavaScript
"use strict";
|
|
|
|
class trdom_menubar {
|
|
#element = document.createElement('div');
|
|
getElement() {
|
|
return this.#element;
|
|
}
|
|
|
|
#menuNodes = {};
|
|
addMenuNode(name, element, after = null) {
|
|
//TODO: add ID checks and after support
|
|
this.#menuNodes[name] = element;
|
|
this.#element.appendChild(element);
|
|
}
|
|
|
|
constructor () {
|
|
this.#element.classList.add('trweb_header');
|
|
}
|
|
}
|