Spaces:
Running
Running
P01yH3dr0n
commited on
Commit
•
8584ad1
1
Parent(s):
4623262
fix jump textbox rerender
Browse files
app.py
CHANGED
@@ -214,9 +214,9 @@ def load_javascript():
|
|
214 |
gr.routes.templates.TemplateResponse = template_response
|
215 |
|
216 |
def send_and_jump(component, fn, inputs, outputs, tab, trigger):
|
217 |
-
component.click(fn, inputs=inputs, outputs=outputs)
|
218 |
-
|
219 |
-
js="(x) => { if (x !== null && x != 0) document.getElementById('" + tab + "-button').click();
|
220 |
inputs=trigger)
|
221 |
|
222 |
def send_jump_select(component, fn, inputs, outputs, tab, accordin, trigger, secondary=None):
|
@@ -224,11 +224,11 @@ def send_jump_select(component, fn, inputs, outputs, tab, accordin, trigger, sec
|
|
224 |
if secondary is not None:
|
225 |
extra_js = "document.getElementById('" + secondary + "-button').click();"
|
226 |
component.click(fn, inputs=inputs, outputs=outputs).success(
|
227 |
-
fn=None,
|
228 |
-
js="(x) => { if (x !== null && x != 0) document.getElementById('" + tab + "-button').click();" + extra_js + " return null; }",
|
229 |
-
inputs=trigger).success(
|
230 |
lambda x: gr.Accordion(open=True) if x else gr.Accordion(), inputs=trigger, outputs=accordin)
|
231 |
-
|
|
|
|
|
|
|
232 |
def ui():
|
233 |
load_javascript()
|
234 |
set_token(os.environ.get('token'))
|
|
|
214 |
gr.routes.templates.TemplateResponse = template_response
|
215 |
|
216 |
def send_and_jump(component, fn, inputs, outputs, tab, trigger):
|
217 |
+
component.click(fn, inputs=inputs, outputs=outputs)
|
218 |
+
component.click(fn=None,
|
219 |
+
js="(x) => { if (x !== null && x != 0) document.getElementById('" + tab + "-button').click();}",
|
220 |
inputs=trigger)
|
221 |
|
222 |
def send_jump_select(component, fn, inputs, outputs, tab, accordin, trigger, secondary=None):
|
|
|
224 |
if secondary is not None:
|
225 |
extra_js = "document.getElementById('" + secondary + "-button').click();"
|
226 |
component.click(fn, inputs=inputs, outputs=outputs).success(
|
|
|
|
|
|
|
227 |
lambda x: gr.Accordion(open=True) if x else gr.Accordion(), inputs=trigger, outputs=accordin)
|
228 |
+
component.click(fn=None,
|
229 |
+
js="(x) => { if (x !== null && x != 0) document.getElementById('" + tab + "-button').click();" + extra_js + " return null; }",
|
230 |
+
inputs=trigger)
|
231 |
+
|
232 |
def ui():
|
233 |
load_javascript()
|
234 |
set_token(os.environ.get('token'))
|