Skip to content

Commit

Permalink
FIX: prompt & confirm dialog on key enter
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Sep 14, 2023
1 parent f7de35a commit 700c820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions htbulma/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def confirm(self, content, ok, ko=None,txtok="OK",txtko="Cancel"): # -> o.value
ko=lambda o: None

x=Modal(main, canClose=True)
x.onkey = lambda valid: x( f"document.getElementById('{id(valid and bok or bko)}').click()" )
x.onkey = lambda valid: x.call( f"document.getElementById('{id(valid and bok or bko)}').click()" )
bok["onclick"].bind(ok).bind(x.close)
bko["onclick"].bind(ko).bind(x.close)

Expand Down Expand Up @@ -223,7 +223,7 @@ def getv(o,x):
o.value = x

x=Modal(main, canClose=True, full=False)
x.onkey = lambda valid: x( f"document.getElementById('{id(valid and bok or bko)}').click()" )
x.onkey = lambda valid: x.call( f"document.getElementById('{id(valid and bok or bko)}').click()" )

js_get_value = b"document.getElementById('%d').value" % id(input)
bok["onclick"].bind( getv, js_get_value ).bind(ok).bind(x.close)
Expand Down

0 comments on commit 700c820

Please sign in to comment.