diff options
| author | Jonas <32615971+jonas-w@users.noreply.github.com> | 2022-02-25 19:29:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-25 19:29:12 +0100 |
| commit | 6de449811d5b07d0d88b2de4670715251463948a (patch) | |
| tree | 0878c2415ca1fd77acc45c821e63634904d3019d /assets/js/handlers.js | |
| parent | f8b29674b2f09c46b74f435a485bebd04c8ce73d (diff) | |
| parent | 081fd541afc9b2f9b821e0f8f4c66dda0839295c (diff) | |
| download | invidious-6de449811d5b07d0d88b2de4670715251463948a.tar.gz invidious-6de449811d5b07d0d88b2de4670715251463948a.tar.bz2 invidious-6de449811d5b07d0d88b2de4670715251463948a.zip | |
Merge branch 'iv-org:master' into verified-badge
Diffstat (limited to 'assets/js/handlers.js')
| -rw-r--r-- | assets/js/handlers.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/assets/js/handlers.js b/assets/js/handlers.js index d3957b89..02175957 100644 --- a/assets/js/handlers.js +++ b/assets/js/handlers.js @@ -150,13 +150,13 @@ // Ignore shortcuts if any text input is focused let focused_tag = document.activeElement.tagName.toLowerCase(); - let focused_type = document.activeElement.type.toLowerCase(); - let allowed = /^(button|checkbox|file|radio|submit)$/; + const allowed = /^(button|checkbox|file|radio|submit)$/; - if (focused_tag === "textarea" || - (focused_tag === "input" && !focused_type.match(allowed)) - ) - return; + if (focused_tag === "textarea") return; + if (focused_tag === "input") { + let focused_type = document.activeElement.type.toLowerCase(); + if (!focused_type.match(allowed)) return; + } // Focus search bar on '/' if (event.key == "/") { |
