diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-06 11:59:09 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-06 11:59:09 +0200 |
| commit | 0ac33061f8275a6808276adfa8ea8b8dcd92d7c9 (patch) | |
| tree | b3075f8bb56e833647444e93945b3ccd7dd8e13c /frontend/index.ts | |
| parent | da56ce47d2e275db58e429a3d8ab85290541ca6f (diff) | |
feat(frontend): better link style in light theme
and rename /log route to /logs/
Diffstat (limited to 'frontend/index.ts')
| -rw-r--r-- | frontend/index.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/frontend/index.ts b/frontend/index.ts index d4fbe2a..1d87f0a 100644 --- a/frontend/index.ts +++ b/frontend/index.ts @@ -5,7 +5,9 @@ htmx.config.historyRestoreAsHxRequest = false; function setupAnchors() { document.querySelectorAll("a").forEach(e => { // stuff related to external links are already handled in the backend - if (!e.href.startsWith(window.location.origin) && /https?:\/\//.test(e.href)) return + if (!e.href.startsWith(window.location.origin) && /https?:\/\//.test(e.href)) return; + if (e.href == window.location.href) e.classList.add("target"); + else e.classList.remove("target"); if (e.hasAttribute("hx-trigger")) return; e.setAttribute("hx-get", e.href) e.setAttribute("hx-trigger", "click") |
