fix a bug previouly concealed by window.event;

hitting enter would clear out an entire chain of modals,
because the event didn't get consumed like it should,
so let's make double sure that will be the case
This commit is contained in:
ed 2023-11-30 22:40:30 +00:00
parent 00812cb1da
commit 4a98b73915
2 changed files with 13 additions and 3 deletions

View file

@ -931,6 +931,11 @@ var set_lno = (function () {
// hotkeys / toolbar
(function () {
var keydown = function (ev) {
if (!ev && window.event) {
ev = window.event;
toast.warn(10, 'hello from fallback code ;_;\ncheck console trace');
console.error('using window.event');
}
var kc = ev.code || ev.keyCode || ev.which,
editing = document.activeElement == dom_src;

View file

@ -277,6 +277,11 @@ function anymod(e, shift_ok) {
function ev(e) {
if (!e && window.event) {
e = window.event;
toast.warn(10, 'hello from fallback code ;_;\ncheck console trace');
console.error('using window.event');
}
if (!e)
return;
@ -1535,16 +1540,16 @@ var modal = (function () {
if (k == 'Enter') {
if (ae && ae == eng)
return ng();
return ng(e);
return ok();
return ok(e);
}
if ((k == 'ArrowLeft' || k == 'ArrowRight') && eng && (ae == eok || ae == eng))
return (ae == eok ? eng : eok).focus() || ev(e);
if (k == 'Escape')
return ng();
return ng(e);
}
var next = function () {