diff options
| author | Volpeon <git@volpeon.ink> | 2022-06-19 17:57:09 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2022-06-19 17:57:09 +0200 |
| commit | 787f3fd33b0f1828283fe6ec4e5f55623cde96c8 (patch) | |
| tree | 3ceab32f14f1dc174eb12252709ac8b5baa0b956 /content | |
| parent | Update (diff) | |
| download | volpeon.ink-787f3fd33b0f1828283fe6ec4e5f55623cde96c8.tar.gz volpeon.ink-787f3fd33b0f1828283fe6ec4e5f55623cde96c8.tar.bz2 volpeon.ink-787f3fd33b0f1828283fe6ec4e5f55623cde96c8.zip | |
Update
Diffstat (limited to 'content')
| -rw-r--r-- | content/lightbox.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/content/lightbox.js b/content/lightbox.js index deb5cce..39a5074 100644 --- a/content/lightbox.js +++ b/content/lightbox.js | |||
| @@ -39,13 +39,9 @@ | |||
| 39 | images[i].thumbnailEl.classList.add("is-selected"); | 39 | images[i].thumbnailEl.classList.add("is-selected"); |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | const prev = () => { | 42 | const prev = () => setIndex(currentIndex > 0 ? currentIndex - 1 : figureEls.length - 1); |
| 43 | setIndex(currentIndex > 0 ? currentIndex - 1 : figureEls.length - 1); | ||
| 44 | }; | ||
| 45 | 43 | ||
| 46 | const next = () => { | 44 | const next = () => setIndex(currentIndex < figureEls.length - 1 ? currentIndex + 1 : 0); |
| 47 | setIndex(currentIndex < figureEls.length - 1 ? currentIndex + 1 : 0); | ||
| 48 | }; | ||
| 49 | 45 | ||
| 50 | lightboxCloseEl?.addEventListener("click", hide); | 46 | lightboxCloseEl?.addEventListener("click", hide); |
| 51 | lightboxPrevEl.addEventListener("click", prev); | 47 | lightboxPrevEl.addEventListener("click", prev); |
