Commit 23c6b5f1 authored by AUTOMATIC1111's avatar AUTOMATIC1111
Browse files

fix style editing dialog breaking if it's opened in both img2img and txt2img tabs

parent c2463b53
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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');
+1 −1
Original line number Diff line number Diff line
@@ -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")