mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 21:21:24 -07:00
WebUI: Filter list improvements
A couple of tweaks to make them a little bit better: 1. Make highlighting functions more consistent (this also fixes minuscule bug when no filter item in tracker list is highlighted due to a type mismatch) 2. Use [event delegation](https://javascript.info/event-delegation) to handle filter toggling & item selection 3. Other minor improvements (everything should work like it was previously) PR #21191.
This commit is contained in:
parent
39dd415d43
commit
5b7c9d5725
5 changed files with 163 additions and 150 deletions
|
@ -1456,8 +1456,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
}
|
||||
}
|
||||
|
||||
const trackerHashInt = Number.parseInt(trackerHash, 10);
|
||||
switch (trackerHashInt) {
|
||||
switch (trackerHash) {
|
||||
case TRACKERS_ALL:
|
||||
break; // do nothing
|
||||
case TRACKERS_TRACKERLESS:
|
||||
|
@ -1465,7 +1464,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
return false;
|
||||
break;
|
||||
default: {
|
||||
const tracker = trackerList.get(trackerHashInt);
|
||||
const tracker = trackerList.get(trackerHash);
|
||||
if (tracker) {
|
||||
let found = false;
|
||||
for (const torrents of tracker.trackerTorrentMap.values()) {
|
||||
|
@ -1537,7 +1536,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
|
||||
const rows = this.rows.getValues();
|
||||
for (let i = 0; i < rows.length; ++i) {
|
||||
if (this.applyFilter(rows[i], selected_filter, selected_category, selectedTag, selectedTracker, filterTerms)) {
|
||||
if (this.applyFilter(rows[i], selectedStatus, selectedCategory, selectedTag, selectedTracker, filterTerms)) {
|
||||
filteredRows.push(rows[i]);
|
||||
filteredRows[rows[i].rowId] = rows[i];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue