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..737fe483b 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(); @@ -164,6 +165,7 @@ function modalLivePreviewToggle(event) { const modalToggleLivePreview = gradioApp().getElementById("modal_toggle_live_preview"); opts.js_live_preview_in_modal_lightbox = !opts.js_live_preview_in_modal_lightbox; modalToggleLivePreview.innerHTML = opts.js_live_preview_in_modal_lightbox ? "🗇" : "🗆"; + updateModalImageIfVisible(); event.stopPropagation(); } 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); diff --git a/style.css b/style.css index 0b255bc48..223795263 100644 --- a/style.css +++ b/style.css @@ -602,6 +602,7 @@ table.popup-table .link{ background: var(--background-fill-primary); width: 100%; height: 100%; + pointer-events: none; } .livePreview img{