diff --git a/.eslintrc.js b/.eslintrc.js index 2e7258f6b..aa8039f61 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -88,6 +88,7 @@ module.exports = { // imageviewer.js modalPrevImage: "readonly", modalNextImage: "readonly", + updateModalImageIfVisible: "readonly", // localStorage.js localSet: "readonly", localGet: "readonly", diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js index 979d05de5..69159be98 100644 --- a/javascript/imageviewer.js +++ b/javascript/imageviewer.js @@ -54,6 +54,7 @@ function updateOnBackgroundChange() { updateModalImage(); } } +const updateModalImageIfVisible = updateOnBackgroundChange; function modalImageSwitch(offset) { var galleryButtons = all_gallery_buttons(); diff --git a/javascript/progressbar.js b/javascript/progressbar.js index c81a41e9a..e7864bba9 100644 --- a/javascript/progressbar.js +++ b/javascript/progressbar.js @@ -190,7 +190,7 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre livePreview.className = 'livePreview'; gallery.insertBefore(livePreview, gallery.firstElementChild); } - + updateModalImageIfVisible(); livePreview.appendChild(img); if (livePreview.childElementCount > 2) { livePreview.removeChild(livePreview.firstElementChild);