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 committed 2023-11-30 22:40:30 +00:00
1 parent 00812cb1da
commit 4a98b73915
2 files changed
+13 -3

No files matched your search

+5
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;
+8 -3
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 () {