mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
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:
parent
00812cb1da
commit
4a98b73915
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue