mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
WebUI: Focus on filter field using Ctrl+F
Some checks are pending
CI - File health / Check (push) Waiting to run
CI - macOS / Build (push) Waiting to run
CI - Python / Check (push) Waiting to run
CI - Ubuntu / Build (push) Waiting to run
CI - WebUI / Check (push) Waiting to run
CI - Windows / Build (push) Waiting to run
Some checks are pending
CI - File health / Check (push) Waiting to run
CI - macOS / Build (push) Waiting to run
CI - Python / Check (push) Waiting to run
CI - Ubuntu / Build (push) Waiting to run
CI - WebUI / Check (push) Waiting to run
CI - Windows / Build (push) Waiting to run
This supports the filters on the Transfers, Search, and Execution Log tabs. Closes #15482. PR #22946.
This commit is contained in:
parent
2ebe8595c9
commit
399707fdc5
1 changed files with 27 additions and 1 deletions
|
@ -1755,7 +1755,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
|||
switch (event.key) {
|
||||
case "a":
|
||||
case "A":
|
||||
if (event.ctrlKey) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
if ((event.target.nodeName === "INPUT") || (event.target.nodeName === "TEXTAREA"))
|
||||
return;
|
||||
if (event.target.isContentEditable)
|
||||
|
@ -1773,6 +1773,32 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
|||
event.preventDefault();
|
||||
deleteSelectedTorrentsFN(event.shiftKey);
|
||||
break;
|
||||
|
||||
case "f":
|
||||
case "F":
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
if ((event.target.nodeName === "INPUT") || (event.target.nodeName === "TEXTAREA"))
|
||||
return;
|
||||
if (event.target.isContentEditable)
|
||||
return;
|
||||
|
||||
const logsFilterElem = document.getElementById("filterTextInput");
|
||||
const searchFilterElem = document.getElementById("searchInNameFilter");
|
||||
const torrentsFilterElem = document.getElementById("torrentsFilterInput");
|
||||
if (logsFilterElem?.isVisible()) {
|
||||
event.preventDefault();
|
||||
logsFilterElem.focus();
|
||||
}
|
||||
else if (searchFilterElem?.isVisible()) {
|
||||
event.preventDefault();
|
||||
searchFilterElem.focus();
|
||||
}
|
||||
else if (torrentsFilterElem?.isVisible()) {
|
||||
event.preventDefault();
|
||||
torrentsFilterElem.focus();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue