mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
fix style editing dialog breaking if it's opened in both img2img and txt2img tabs
This commit is contained in:
parent
c2463b5323
commit
23c6b5f124
@ -249,6 +249,15 @@ function popup(contents) {
|
|||||||
globalPopup.style.display = "flex";
|
globalPopup.style.display = "flex";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var storedPopupIds = {};
|
||||||
|
function popupId(id) {
|
||||||
|
if(! storedPopupIds[id]){
|
||||||
|
storedPopupIds[id] = gradioApp().getElementById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
popup(storedPopupIds[id]);
|
||||||
|
}
|
||||||
|
|
||||||
function extraNetworksShowMetadata(text) {
|
function extraNetworksShowMetadata(text) {
|
||||||
var elem = document.createElement('pre');
|
var elem = document.createElement('pre');
|
||||||
elem.classList.add('popup-metadata');
|
elem.classList.add('popup-metadata');
|
||||||
|
@ -261,7 +261,7 @@ def setup_dialog(button_show, dialog, *, button_close=None):
|
|||||||
fn=lambda: gr.update(visible=True),
|
fn=lambda: gr.update(visible=True),
|
||||||
inputs=[],
|
inputs=[],
|
||||||
outputs=[dialog],
|
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:
|
if button_close:
|
||||||
button_close.click(fn=None, _js="closePopup")
|
button_close.click(fn=None, _js="closePopup")
|
||||||
|
Loading…
Reference in New Issue
Block a user