diff options
Diffstat (limited to 'code/api/wwwroot/scripts/components/profile-modal.js')
| -rw-r--r-- | code/api/wwwroot/scripts/components/profile-modal.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/code/api/wwwroot/scripts/components/profile-modal.js b/code/api/wwwroot/scripts/components/profile-modal.js index acc666b..6d7ad27 100644 --- a/code/api/wwwroot/scripts/components/profile-modal.js +++ b/code/api/wwwroot/scripts/components/profile-modal.js @@ -1,16 +1,28 @@ class ProfileModal extends HTMLElement { + static observedAttributes = ["target-id"]; + #attributes = []; + constructor() { super(); + this.#attributes.push({name: "target-id", value: this.getAttribute("target-id")}); const _session = session.get_sync(); - const root = create_element("div", {}, [ + const root = create_element("template", {}, [ create_element("h4", {innerText: _session.username, style: {margin: 0}}), create_element("p", {innerText: _session.role}), create_element("button", {innerText: "Log out", classList: ["do-logout"]}), - create_element("pre", {innerText: Temporal.Now.instant().toString()}) ]); this.style.padding = "5px"; this.innerHTML = root.innerHTML; } + + attributeChangedCallback(name, oldValue, newValue) { + } } -customElements.define("profile-modal", ProfileModal); +customElements.define("profile-modal", ProfileModal, {extends: "dialog"}); + +class ElementBase extends HTMLElement { + constructor() { + super(); + } +} |
