diff options
| author | 2021-10-19 10:05:30 +0200 | |
|---|---|---|
| committer | 2021-10-19 10:05:30 +0200 | |
| commit | 24c2c47d4ba5783625bba9385a1c144d791985d9 (patch) | |
| tree | c409fbace9d196bba30ce2d4dbf1aec912c22654 /p/scripts | |
| parent | f934eb981e21f9eecca6d944b77dd7a07c74eb06 (diff) | |
[chore] Replace direct .onkeydown override with addEventListener (#3902)
Removes inextensible bad example to prevent it from being copied. See <https://github.com/FreshRSS/FreshRSS/pull/3901/files#r731292613>.
Diffstat (limited to 'p/scripts')
| -rw-r--r-- | p/scripts/main.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index 7016929d1..1707a09b8 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -796,7 +796,7 @@ function init_shortcuts() { context.shortcuts[k] = (context.shortcuts[k] || '').toUpperCase(); }); - document.body.onkeydown = function (ev) { + document.addEventListener('keydown', ev => { if (ev.target.closest('input, textarea') || ev.ctrlKey || ev.metaKey || (ev.altKey && ev.shiftKey)) { return true; @@ -913,7 +913,7 @@ function init_shortcuts() { if (k === s.rss_view) { delayedClick(document.querySelector('#nav_menu_views .view-rss')); return false; } if (k === s.toggle_media) { toggle_media(); return false; } return true; - }; + }); } function init_stream(stream) { |
