From f5fa4f7d58344c2dc722d1f37c1d7a008f6ee9b3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 7 Sep 2023 20:24:21 +0200 Subject: new element creation helper --- client-web/source/user/mod.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client-web/source/user/mod.ts') diff --git a/client-web/source/user/mod.ts b/client-web/source/user/mod.ts index 93042ca..67b3cd5 100644 --- a/client-web/source/user/mod.ts +++ b/client-web/source/user/mod.ts @@ -5,7 +5,7 @@ */ /// -import { ediv, epre, espan } from "../helper.ts"; +import { e } from "../helper.ts"; import { Room } from "../room.ts"; export class User { @@ -14,12 +14,12 @@ export class User { get name() { return this._name } get display_name() { return this.name ?? "Unknown" } - name_el = espan(this.display_name) - stats_el = epre("") - el = ediv({ class: "user" }) + name_el = e("span", {}, this.display_name) + stats_el = e("pre", {}) + el = e("div", { class: "user" }) constructor(public room: Room, public id: number) { - const info_el = ediv({ class: "info" }) + const info_el = e("div", { class: "info" }) this.name_el.textContent = this.display_name this.name_el.classList.add("name") info_el.append(this.name_el, this.stats_el) -- cgit v1.2.3-70-g09d2