diff options
author | Lia Lenckowski <lialenck@protonmail.com> | 2023-08-14 17:39:18 +0200 |
---|---|---|
committer | Lia Lenckowski <lialenck@protonmail.com> | 2023-08-14 17:39:18 +0200 |
commit | 44e16504a1605d1d00f202863935767326cd453c (patch) | |
tree | 2bad385871dd1b602aff4d55477084ca541cbb0e /frontend/helper.ts | |
parent | 3df03c42763dccf2993a0a76bdf36e2cbb3674c7 (diff) | |
download | fastbangs-44e16504a1605d1d00f202863935767326cd453c.tar fastbangs-44e16504a1605d1d00f202863935767326cd453c.tar.bz2 fastbangs-44e16504a1605d1d00f202863935767326cd453c.tar.zst |
implement searching for engines/bangs
Diffstat (limited to 'frontend/helper.ts')
-rw-r--r-- | frontend/helper.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/helper.ts b/frontend/helper.ts index 2ecfc35..6e7ca5c 100644 --- a/frontend/helper.ts +++ b/frontend/helper.ts @@ -17,7 +17,7 @@ function apply_opts<E extends HTMLElement>(e: E, o: Opts<E>) { if (o.onchange) e.onchange = () => o.onchange!(e) if (o.for) (e as unknown as HTMLLabelElement).htmlFor = o.for if (o.type && e instanceof HTMLInputElement) e.type = o.type - if (o.href && e instanceof HTMLAnchorElement) e.href = o.href; + if (o.href && e instanceof HTMLAnchorElement) e.href = o.href if (typeof o?.class == "string") e.classList.add(o.class) if (typeof o?.class == "object") e.classList.add(...o.class) } @@ -26,7 +26,7 @@ export function e<K extends keyof HTMLElementTagNameMap>(name: K, opts: Opts<HTM const el = document.createElement(name) apply_opts(el, opts) for (const c of children) { - if (typeof c == "string") el.textContent += c; + if (typeof c == "string") el.textContent += c else el.append(c) } return el |