aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorDepFA <35278260+dfaker@users.noreply.github.com>2022-09-19 14:05:30 +0100
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-19 16:43:08 +0300
commitbf1f3b8daf22a79ef15708edbbfb623157de1307 (patch)
treed408c47fc5f6d7e643ebc5e47214c7f3381a15a3 /javascript
parent86021511afa5ae55a631b0346184001fe1ed3d14 (diff)
Rely on opts being pre-populated
Diffstat (limited to 'javascript')
-rw-r--r--javascript/imageviewer.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js
index 564f8eb0..20531fd4 100644
--- a/javascript/imageviewer.js
+++ b/javascript/imageviewer.js
@@ -97,19 +97,12 @@ function galleryImageHandler(e){
}
onUiUpdate(function(){
- fullImg_preview = gradioApp().querySelectorAll('img.w-full')
- if(fullImg_preview != null){
- fullImg_preview.forEach(galleryImageHandler);
- }
-
- if(Object.keys(opts).length != 0) return;
-
- json_elem = gradioApp().getElementById('settings_json')
- if(json_elem == null) return;
+ fullImg_preview = gradioApp().querySelectorAll('img.w-full')
+ if(fullImg_preview != null){
+ fullImg_preview.forEach(galleryImageHandler);
+ }
- textarea = json_elem.querySelector('textarea')
- jsdata = textarea.value
- opts = JSON.parse(jsdata)
+ if(Object.keys(opts).length == 0) return;
if(!window.lightbox_settings_applied){
window.lightbox_settings_applied = true;