Skip to content

Commit 4207597

Browse files
committed
Fix modal live preview not updating
Due to the behavior of scheduleAfterUiUpdateCallbacks if opts.live_preview_refresh_period < 200ms live preview in Modal image viewer may not update Assing updateModalImageIfVisible as alias for updateOnBackgroundChange as the origin name is too generic
1 parent 017ced6 commit 4207597

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ module.exports = {
8888
// imageviewer.js
8989
modalPrevImage: "readonly",
9090
modalNextImage: "readonly",
91+
updateModalImageIfVisible: "readonly",
9192
// localStorage.js
9293
localSet: "readonly",
9394
localGet: "readonly",

javascript/imageviewer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function updateOnBackgroundChange() {
5454
updateModalImage();
5555
}
5656
}
57+
const updateModalImageIfVisible = updateOnBackgroundChange;
5758

5859
function modalImageSwitch(offset) {
5960
var galleryButtons = all_gallery_buttons();

javascript/progressbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
190190
livePreview.className = 'livePreview';
191191
gallery.insertBefore(livePreview, gallery.firstElementChild);
192192
}
193-
193+
updateModalImageIfVisible();
194194
livePreview.appendChild(img);
195195
if (livePreview.childElementCount > 2) {
196196
livePreview.removeChild(livePreview.firstElementChild);

0 commit comments

Comments
 (0)