Skip to content

Commit

Permalink
Rely on opts being pre-populated
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaker authored and AUTOMATIC1111 committed Sep 19, 2022
1 parent 8602151 commit bf1f3b8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions javascript/imageviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bf1f3b8

Please sign in to comment.