aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorinnovaciones <sonygarcia99@gmail.com>2022-09-20 13:05:25 -0500
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-22 08:12:10 +0300
commitf183e09fcc17ee28c2ede2c5f0506c630d79486e (patch)
treed5f21fde9996df567783e83d0b806d52b4018d5a /javascript
parent3eaae8ae655346c8c510b677bd48021b86842561 (diff)
Fix progress bar position
Diffstat (limited to 'javascript')
-rw-r--r--javascript/progressbar.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/javascript/progressbar.js b/javascript/progressbar.js
index 065f259b..0f33851f 100644
--- a/javascript/progressbar.js
+++ b/javascript/progressbar.js
@@ -4,6 +4,7 @@ global_progressbar = null
onUiUpdate(function(){
progressbar = gradioApp().getElementById('progressbar')
+ progressDiv = gradioApp().querySelectorAll('.progressDiv').length > 0;
if(progressbar!= null && progressbar != global_progressbar){
global_progressbar = progressbar
@@ -16,12 +17,18 @@ onUiUpdate(function(){
if(txt2img_preview != null && txt2img_gallery != null){
txt2img_preview.style.width = txt2img_gallery.clientWidth + "px"
- txt2img_preview.style.height = txt2img_gallery.clientHeight + "px"
+ txt2img_preview.style.height = txt2img_gallery.clientHeight + "px"
+ if(!progressDiv){
+ progressbar.style.display = "none"
+ }
}
if(img2img_preview != null && img2img_gallery != null){
img2img_preview.style.width = img2img_gallery.clientWidth + "px"
- img2img_preview.style.height = img2img_gallery.clientHeight + "px"
+ img2img_preview.style.height = img2img_gallery.clientHeight + "px"
+ if(!progressDiv){
+ progressbar.style.display = "none"
+ }
}
window.setTimeout(requestMoreProgress, 500)
@@ -35,6 +42,10 @@ function requestMoreProgress(){
if(btn==null) return;
btn.click();
+ progressDiv = gradioApp().querySelectorAll('.progressDiv').length > 0;
+ if(progressDiv){
+ progressbar.style.display = "block"
+ }
}
function requestProgress(){
@@ -43,4 +54,3 @@ function requestProgress(){
btn.click();
}
-