From dd93c47abfd9ed357f5d5827311d836ea399a236 Mon Sep 17 00:00:00 2001 From: bluelovers Date: Tue, 7 May 2024 19:53:18 +0800 Subject: [PATCH] Update imageviewer.js --- javascript/imageviewer.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js index d4d4f016d..a3f08ad16 100644 --- a/javascript/imageviewer.js +++ b/javascript/imageviewer.js @@ -51,14 +51,7 @@ function modalImageSwitch(offset) { var galleryButtons = all_gallery_buttons(); if (galleryButtons.length > 1) { - var currentButton = selected_gallery_button(); - - var result = -1; - galleryButtons.forEach(function(v, i) { - if (v == currentButton) { - result = i; - } - }); + var result = selected_gallery_index(); if (result != -1) { var nextButton = galleryButtons[negmod((result + offset), galleryButtons.length)];