allow navigation in lightbox over all images

This commit is contained in:
Karl 2025-06-06 12:31:30 +01:00
parent 9ce6ff25ea
commit 336c03a888

View File

@ -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";
}