js optimizations

This commit is contained in:
Vladimir Mandic
2023-06-05 14:25:57 -04:00
parent c52fb69dde
commit efbe364f7d
30 changed files with 697 additions and 70 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
/* global gradioApp, onUiUpdate */
// A full size 'lightbox' preview modal shown when left clicking on gallery previews
function closeModal() {
gradioApp().getElementById('lightboxModal').style.display = 'none';
@@ -143,7 +142,7 @@ function galleryImageHandler(e) {
e.onclick = showGalleryImage;
}
onUiUpdate(() => {
onAfterUiUpdate(() => {
fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > div > img');
if (fullImg_preview != null) fullImg_preview.forEach(setupImageForLightbox);
updateOnBackgroundChange();