Rely on opts being pre-populated
This commit is contained in:
parent
86021511af
commit
bf1f3b8daf
1 changed files with 5 additions and 12 deletions
|
@ -97,19 +97,12 @@ function galleryImageHandler(e){
|
||||||
}
|
}
|
||||||
|
|
||||||
onUiUpdate(function(){
|
onUiUpdate(function(){
|
||||||
fullImg_preview = gradioApp().querySelectorAll('img.w-full')
|
fullImg_preview = gradioApp().querySelectorAll('img.w-full')
|
||||||
if(fullImg_preview != null){
|
if(fullImg_preview != null){
|
||||||
fullImg_preview.forEach(galleryImageHandler);
|
fullImg_preview.forEach(galleryImageHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Object.keys(opts).length != 0) return;
|
if(Object.keys(opts).length == 0) return;
|
||||||
|
|
||||||
json_elem = gradioApp().getElementById('settings_json')
|
|
||||||
if(json_elem == null) return;
|
|
||||||
|
|
||||||
textarea = json_elem.querySelector('textarea')
|
|
||||||
jsdata = textarea.value
|
|
||||||
opts = JSON.parse(jsdata)
|
|
||||||
|
|
||||||
if(!window.lightbox_settings_applied){
|
if(!window.lightbox_settings_applied){
|
||||||
window.lightbox_settings_applied = true;
|
window.lightbox_settings_applied = true;
|
||||||
|
|
Loading…
Reference in a new issue