diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-05-04 22:12:32 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-05-04 22:12:32 -0500 |
| commit | 5b608a82bd1ebfd109520492cd6d9f54736ae862 (patch) | |
| tree | 35cd29f9a14e65036a3882bdb00e594d8c95f89d /src/index.js | |
| parent | 5284094278ed6e4861edc3dbadb1d53218e6f6d0 (diff) | |
| download | immich-frame-5b608a82bd1ebfd109520492cd6d9f54736ae862.tar.xz immich-frame-5b608a82bd1ebfd109520492cd6d9f54736ae862.zip | |
add icons and bottom controls
Diffstat (limited to 'src/index.js')
| -rw-r--r-- | src/index.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js index 21d0134..59175a0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +import "./icons.js" import initSlides from "./slides.js" initSlides() @@ -29,11 +30,13 @@ window.addEventListener("popstate", pathnameCallback) pathnameCallback() /* add event listeners for anchor elements in footer */ -function anchorRedirect(e) { +function softRedirect(e) { e.preventDefault() - window.history.pushState({}, "", e.target.href); + let a = e.target + while (a.tagName !== "A" && a !== null) + a = a.parentElement + window.history.pushState({}, "", a.href); pathnameCallback() } -for (const a of document.querySelectorAll("footer a")) - a.addEventListener("click", anchorRedirect) +document.querySelector("#menu").addEventListener("click", softRedirect) |
