Merge pull request #15730 from bluelovers/patch-2

Update imageviewer.js
This commit is contained in:
AUTOMATIC1111 2024-06-08 11:42:27 +03:00 committed by GitHub
commit 4aebfe9844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 8 deletions

View File

@ -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)];