aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-27 06:39:37 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-08-27 06:45:08 +0000
commit6139b145f0039b1f428c763f0cd85cd2a96d0d52 (patch)
tree7dc9f327256a1006ec2e1ccd6fe4d5f8c440ef42
parentf331821b2711772aeac124b355628943c9c0c423 (diff)
downloadstable-diffusion-webui-gfx803-6139b145f0039b1f428c763f0cd85cd2a96d0d52.tar.gz
stable-diffusion-webui-gfx803-6139b145f0039b1f428c763f0cd85cd2a96d0d52.tar.bz2
stable-diffusion-webui-gfx803-6139b145f0039b1f428c763f0cd85cd2a96d0d52.zip
fix style editing dialog breaking if it's opened in both img2img and txt2img tabs
-rw-r--r--javascript/extraNetworks.js9
-rw-r--r--modules/ui_common.py2
2 files changed, 10 insertions, 1 deletions
diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js
index 3bc723d3..ad1a4e00 100644
--- a/javascript/extraNetworks.js
+++ b/javascript/extraNetworks.js
@@ -249,6 +249,15 @@ function popup(contents) {
globalPopup.style.display = "flex";
}
+var storedPopupIds = {};
+function popupId(id) {
+ if(! storedPopupIds[id]){
+ storedPopupIds[id] = gradioApp().getElementById(id);
+ }
+
+ popup(storedPopupIds[id]);
+}
+
function extraNetworksShowMetadata(text) {
var elem = document.createElement('pre');
elem.classList.add('popup-metadata');
diff --git a/modules/ui_common.py b/modules/ui_common.py
index eddc4bc8..84a7d7f2 100644
--- a/modules/ui_common.py
+++ b/modules/ui_common.py
@@ -261,7 +261,7 @@ def setup_dialog(button_show, dialog, *, button_close=None):
fn=lambda: gr.update(visible=True),
inputs=[],
outputs=[dialog],
- ).then(fn=None, _js="function(){ popup(gradioApp().getElementById('" + dialog.elem_id + "')); }")
+ ).then(fn=None, _js="function(){ popupId('" + dialog.elem_id + "'); }")
if button_close:
button_close.click(fn=None, _js="closePopup")