enter works now when modal is up.
This commit is contained in:
parent
0dc849af66
commit
f8bc2f0d22
|
@ -1,4 +1,4 @@
|
|||
from browser import window
|
||||
from browser import window, document
|
||||
from message.message import Message, msg
|
||||
|
||||
|
||||
|
@ -37,7 +37,14 @@ class KeyboardPress(Message):
|
|||
return key == "Escape"
|
||||
|
||||
def update_model(self, model):
|
||||
pass
|
||||
key = self.get_arg(0, str)
|
||||
|
||||
# Enter when modal shown -> press ok button
|
||||
if model.modal_shown and key == "Enter":
|
||||
ok_button = document.getElementById("modal-ok")
|
||||
if ok_button is not None:
|
||||
# has to be called in separate thread
|
||||
window.setTimeout(lambda: ok_button.click(), 10)
|
||||
|
||||
|
||||
# a "hack" message for reseting modals #
|
||||
|
|
Loading…
Reference in New Issue
Block a user