mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Add a small delay before processing the key input of search boxes
PR #20465. Closes #20025. Closes #20235.
This commit is contained in:
parent
46e8ee50c8
commit
15697f904d
14 changed files with 87 additions and 50 deletions
|
@ -695,6 +695,8 @@ window.addEventListener("DOMContentLoaded", function() {
|
|||
$('error_div').set('html', '');
|
||||
if (response) {
|
||||
clearTimeout(torrentsFilterInputTimer);
|
||||
torrentsFilterInputTimer = -1;
|
||||
|
||||
let torrentsTableSelectedRows;
|
||||
let update_categories = false;
|
||||
let updateTags = false;
|
||||
|
@ -1449,18 +1451,14 @@ window.addEventListener("DOMContentLoaded", function() {
|
|||
$('torrentFilesFilterToolbar').addClass("invisible");
|
||||
};
|
||||
|
||||
let prevTorrentsFilterValue;
|
||||
let torrentsFilterInputTimer = null;
|
||||
// listen for changes to torrentsFilterInput
|
||||
$('torrentsFilterInput').addEvent('input', function() {
|
||||
const value = $('torrentsFilterInput').get("value");
|
||||
if (value !== prevTorrentsFilterValue) {
|
||||
prevTorrentsFilterValue = value;
|
||||
clearTimeout(torrentsFilterInputTimer);
|
||||
torrentsFilterInputTimer = setTimeout(function() {
|
||||
torrentsTable.updateTable(false);
|
||||
}, 400);
|
||||
}
|
||||
let torrentsFilterInputTimer = -1;
|
||||
$('torrentsFilterInput').addEvent('input', () => {
|
||||
clearTimeout(torrentsFilterInputTimer);
|
||||
torrentsFilterInputTimer = setTimeout(() => {
|
||||
torrentsFilterInputTimer = -1;
|
||||
torrentsTable.updateTable();
|
||||
}, window.qBittorrent.Misc.FILTER_INPUT_DELAY);
|
||||
});
|
||||
|
||||
$('transfersTabLink').addEvent('click', showTransfersTab);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue