mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 10:50:23 +00:00
fix the issue with incorrect js options on page load
add a setting for lightbox max size images use setting for lightbox max size images late to let user change it and see results
This commit is contained in:
@@ -71,6 +71,7 @@ function showGalleryImage(){
|
||||
|
||||
e.addEventListener('click', function (evt) {
|
||||
if(!opts.js_modal_lightbox) return;
|
||||
modalZoomSet(gradioApp().getElementById('modalImage'), opts.js_modal_lightbox_initialy_zoomed)
|
||||
showModal(evt)
|
||||
},true);
|
||||
}
|
||||
@@ -80,13 +81,17 @@ function showGalleryImage(){
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function modalZoomToggle(event){
|
||||
modalImage = gradioApp().getElementById("modalImage");
|
||||
if( !modalImage.classList.contains('modalImageFullscreen') ){
|
||||
function modalZoomSet(modalImage, enable){
|
||||
if( enable ){
|
||||
modalImage.classList.add('modalImageFullscreen');
|
||||
}else{
|
||||
} else{
|
||||
modalImage.classList.remove('modalImageFullscreen');
|
||||
}
|
||||
}
|
||||
|
||||
function modalZoomToggle(event){
|
||||
modalImage = gradioApp().getElementById("modalImage");
|
||||
modalZoomSet(modalImage, !modalImage.classList.contains('modalImageFullscreen'))
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
@@ -101,18 +106,6 @@ onUiUpdate(function(){
|
||||
if(fullImg_preview != null){
|
||||
fullImg_preview.forEach(galleryImageHandler);
|
||||
}
|
||||
|
||||
if(Object.keys(opts).length == 0) return;
|
||||
|
||||
if(!window.lightbox_settings_applied){
|
||||
window.lightbox_settings_applied = true;
|
||||
if(opts.js_modal_lightbox_initialy_zoomed){
|
||||
var imageModal = gradioApp().getElementById('modalImage');
|
||||
if(imageModal){
|
||||
imageModal.className = 'modalImageFullscreen';
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
Reference in New Issue
Block a user