From 336c03a8887aee3b334d781c88aaf186986b0415 Mon Sep 17 00:00:00 2001 From: Karl Date: Fri, 6 Jun 2025 12:31:30 +0100 Subject: [PATCH] allow navigation in lightbox over all images --- templates/gallery.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/gallery.html b/templates/gallery.html index 16c8139..ee648cf 100644 --- a/templates/gallery.html +++ b/templates/gallery.html @@ -286,8 +286,17 @@ function nextImage() { const images = getGalleryImages(); - currentIndex = (currentIndex + 1) % images.length; - showImageAndLoadDetails(currentIndex); + if (currentIndex + 1 >= images.length && loadedCount < allImages.length) { + loadNextBatch(); + // Wait briefly to ensure DOM updates + setTimeout(() => { + currentIndex++; + showImageAndLoadDetails(currentIndex); + }, 100); + } else { + currentIndex = (currentIndex + 1) % images.length; + showImageAndLoadDetails(currentIndex); + } } function prevImage() { @@ -296,6 +305,7 @@ showImageAndLoadDetails(currentIndex); } + function closeLightbox() { document.getElementById("lightbox").style.display = "none"; }