diff options
Diffstat (limited to 'client-web/source/helper.ts')
-rw-r--r-- | client-web/source/helper.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/client-web/source/helper.ts b/client-web/source/helper.ts index 336f7d4..c0c41a3 100644 --- a/client-web/source/helper.ts +++ b/client-web/source/helper.ts @@ -41,10 +41,7 @@ function apply_opts<E extends HTMLElement>(e: E, o: Opts<E>) { export function e<K extends keyof HTMLElementTagNameMap>(name: K, opts: Opts<HTMLElementTagNameMap[K]>, ...children: (HTMLElement | string)[]): HTMLElementTagNameMap[K] { const el = document.createElement(name) apply_opts(el, opts) - for (const c of children) { - if (typeof c == "string") el.textContent += c; - else el.append(c) - } + for (const c of children) el.append(c); return el } @@ -89,4 +86,4 @@ export function array_swap<T>(arr: T[], a: number, b: number) { const temp = arr[a] arr[a] = arr[b] arr[b] = temp -}
\ No newline at end of file +} |