Skip to content

Commit

Permalink
CTRL + F / CMD + F can now be used to focus on the search field.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtrendence committed Sep 27, 2020
1 parent 6278266 commit 157c5cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ document.addEventListener("DOMContentLoaded", () => {
}
});

document.addEventListener("keydown", (e) => {
if((e.ctrlKey && e.key.toLowerCase() === "f" || e.metaKey && e.key.toLowerCase() === "f") && !inputSearch.classList.contains("hidden")) {
inputSearch.focus();
}
});

window.addEventListener("resize", () => {
hideMoreMenu();
hideMoreMenuPlaylist();
Expand Down

0 comments on commit 157c5cd

Please sign in to comment.