add option: Live preview in full page image viewer

make #13459 "show the preview image in the modal view if available" optional
This commit is contained in:
w-e-w
2023-12-06 23:06:32 +09:00
parent f92d61497a
commit 9d2cbf8e97
2 changed files with 2 additions and 1 deletions

View File

@@ -34,7 +34,7 @@ function updateOnBackgroundChange() {
if (modalImage && modalImage.offsetParent) {
let currentButton = selected_gallery_button();
let preview = gradioApp().querySelectorAll('.livePreview > img');
if (preview.length > 0) {
if (opts.js_live_preview_in_modal_lightbox && preview.length > 0) {
// show preview image if available
modalImage.src = preview[preview.length - 1].src;
} else if (currentButton?.children?.length > 0 && modalImage.src != currentButton.children[0].src) {