mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-10 17:35:00 -06:00
Add a small delay before processing the key input of search boxes
PR #20465. Closes #20025. Closes #20235.
This commit is contained in:
@@ -183,7 +183,7 @@
|
||||
};
|
||||
|
||||
let customSyncLogDataInterval = null;
|
||||
let logFilterTimer;
|
||||
let logFilterTimer = -1;
|
||||
let inputtedFilterText = "";
|
||||
let selectBox;
|
||||
let selectedLogLevels = JSON.parse(LocalPreferences.get('qbt_selected_log_levels')) || ['1', '2', '4', '8'];
|
||||
@@ -298,9 +298,11 @@
|
||||
const logFilterChanged = () => {
|
||||
clearTimeout(logFilterTimer);
|
||||
logFilterTimer = setTimeout((curTab) => {
|
||||
logFilterTimer = -1;
|
||||
|
||||
tableInfo[curTab].instance.updateTable(false);
|
||||
updateLabelCount(curTab);
|
||||
}, 400, currentSelectedTab);
|
||||
}, window.qBittorrent.Misc.FILTER_INPUT_DELAY, currentSelectedTab);
|
||||
};
|
||||
|
||||
const setCurrentTab = (tab) => {
|
||||
@@ -322,6 +324,7 @@
|
||||
}
|
||||
|
||||
clearTimeout(logFilterTimer);
|
||||
logFilterTimer = -1;
|
||||
load();
|
||||
|
||||
if (tableInfo[currentSelectedTab].instance.filterText !== getFilterText()) {
|
||||
@@ -378,6 +381,8 @@
|
||||
|
||||
if (response.length > 0) {
|
||||
clearTimeout(logFilterTimer);
|
||||
logFilterTimer = -1;
|
||||
|
||||
for (let i = 0; i < response.length; ++i) {
|
||||
let row;
|
||||
if (curTab === 'main') {
|
||||
|
||||
@@ -230,7 +230,6 @@
|
||||
max: 0.00,
|
||||
maxUnit: 3
|
||||
};
|
||||
let prevNameFilterValue;
|
||||
let selectedCategory = "QBT_TR(All categories)QBT_TR[CONTEXT=SearchEngineWidget]";
|
||||
let selectedPlugin = "all";
|
||||
let prevSelectedPlugin;
|
||||
@@ -255,18 +254,17 @@
|
||||
searchResultsTable.setup('searchResultsTableDiv', 'searchResultsTableFixedHeaderDiv', searchResultsTableContextMenu);
|
||||
getPlugins();
|
||||
|
||||
let searchInNameFilterTimer = null;
|
||||
// listen for changes to searchInNameFilter
|
||||
$('searchInNameFilter').addEvent('input', function() {
|
||||
const value = $('searchInNameFilter').get("value");
|
||||
if (value !== prevNameFilterValue) {
|
||||
prevNameFilterValue = value;
|
||||
clearTimeout(searchInNameFilterTimer);
|
||||
searchInNameFilterTimer = setTimeout(function() {
|
||||
searchText.filterPattern = value;
|
||||
searchFilterChanged();
|
||||
}, 400);
|
||||
}
|
||||
let searchInNameFilterTimer = -1;
|
||||
$('searchInNameFilter').addEvent('input', () => {
|
||||
clearTimeout(searchInNameFilterTimer);
|
||||
searchInNameFilterTimer = setTimeout(() => {
|
||||
searchInNameFilterTimer = -1;
|
||||
|
||||
const value = $('searchInNameFilter').get("value");
|
||||
searchText.filterPattern = value;
|
||||
searchFilterChanged();
|
||||
}, window.qBittorrent.Misc.FILTER_INPUT_DELAY);
|
||||
});
|
||||
|
||||
new Keyboard({
|
||||
|
||||
Reference in New Issue
Block a user