diff options
author | DepFA <35278260+dfaker@users.noreply.github.com> | 2022-09-19 13:05:30 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-09-19 13:43:08 +0000 |
commit | bf1f3b8daf22a79ef15708edbbfb623157de1307 (patch) | |
tree | d408c47fc5f6d7e643ebc5e47214c7f3381a15a3 /javascript | |
parent | 86021511afa5ae55a631b0346184001fe1ed3d14 (diff) | |
download | stable-diffusion-webui-gfx803-bf1f3b8daf22a79ef15708edbbfb623157de1307.tar.gz stable-diffusion-webui-gfx803-bf1f3b8daf22a79ef15708edbbfb623157de1307.tar.bz2 stable-diffusion-webui-gfx803-bf1f3b8daf22a79ef15708edbbfb623157de1307.zip |
Rely on opts being pre-populated
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/imageviewer.js | 17 |
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; |