From 787f3fd33b0f1828283fe6ec4e5f55623cde96c8 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 19 Jun 2022 17:57:09 +0200 Subject: Update --- content/lightbox.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'content/lightbox.js') 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 @@ images[i].thumbnailEl.classList.add("is-selected"); }; - const prev = () => { - setIndex(currentIndex > 0 ? currentIndex - 1 : figureEls.length - 1); - }; + const prev = () => setIndex(currentIndex > 0 ? currentIndex - 1 : figureEls.length - 1); - const next = () => { - setIndex(currentIndex < figureEls.length - 1 ? currentIndex + 1 : 0); - }; + const next = () => setIndex(currentIndex < figureEls.length - 1 ? currentIndex + 1 : 0); lightboxCloseEl?.addEventListener("click", hide); lightboxPrevEl.addEventListener("click", prev); -- cgit v1.2.3-54-g00ecf