diff --git a/copyparty/web/md2.js b/copyparty/web/md2.js index 02c70c75..e8c8ec40 100644 --- a/copyparty/web/md2.js +++ b/copyparty/web/md2.js @@ -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; diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 9dfea822..744781ea 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -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 () {