make clicking extra networks button one more time close the extra networks UI
This commit is contained in:
parent
635499e832
commit
789d47f832
@ -117,8 +117,13 @@ def create_ui(container, button, tabname):
|
|||||||
ui.button_save_preview = gr.Button('Save preview', elem_id=tabname+"_save_preview", visible=False)
|
ui.button_save_preview = gr.Button('Save preview', elem_id=tabname+"_save_preview", visible=False)
|
||||||
ui.preview_target_filename = gr.Textbox('Preview save filename', elem_id=tabname+"_preview_filename", visible=False)
|
ui.preview_target_filename = gr.Textbox('Preview save filename', elem_id=tabname+"_preview_filename", visible=False)
|
||||||
|
|
||||||
button.click(fn=lambda: gr.update(visible=True), inputs=[], outputs=[container])
|
def toggle_visibility(is_visible):
|
||||||
button_close.click(fn=lambda: gr.update(visible=False), inputs=[], outputs=[container])
|
is_visible = not is_visible
|
||||||
|
return is_visible, gr.update(visible=is_visible)
|
||||||
|
|
||||||
|
state_visible = gr.State(value=False)
|
||||||
|
button.click(fn=toggle_visibility, inputs=[state_visible], outputs=[state_visible, container])
|
||||||
|
button_close.click(fn=toggle_visibility, inputs=[state_visible], outputs=[state_visible, container])
|
||||||
|
|
||||||
def refresh():
|
def refresh():
|
||||||
res = []
|
res = []
|
||||||
|
Loading…
Reference in New Issue
Block a user