mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
WebUI: Fix row collapsing with virtual list enabled
Fixes https://github.com/qbittorrent/qBittorrent/issues/23241#issuecomment-3295352816. PR #23542.
This commit is contained in:
@@ -2359,6 +2359,9 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
|
||||
for (const [key, _] of this.collapseState)
|
||||
this.expandNode(key);
|
||||
|
||||
if (this.useVirtualList)
|
||||
this.rerender();
|
||||
}
|
||||
|
||||
collapseAllNodes() {
|
||||
@@ -2370,6 +2373,9 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
if (state.depth >= 1)
|
||||
this.collapseNode(key);
|
||||
}
|
||||
|
||||
if (this.useVirtualList)
|
||||
this.rerender();
|
||||
}
|
||||
|
||||
#updateNodeVisibility(node, shouldHide) {
|
||||
@@ -2741,8 +2747,10 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
|
||||
generateRowsSignature() {
|
||||
const rowsData = [];
|
||||
for (const { rowId } of this.getRowValues())
|
||||
rowsData.push({ ...this.getNode(rowId).serialize(), collapsed: this.isCollapsed(rowId) });
|
||||
for (const { rowId } of this.getRowValues()) {
|
||||
const node = this.getNode(rowId);
|
||||
rowsData.push({ ...node.serialize(), collapsed: this.isCollapsed(node.rowId) });
|
||||
}
|
||||
return JSON.stringify(rowsData);
|
||||
}
|
||||
|
||||
@@ -2771,7 +2779,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
// sort, then filter
|
||||
this.#sortNodesByColumn(root, this.columns[this.sortedColumn]);
|
||||
const rows = (() => {
|
||||
if (this.filterTerms.length === 0) {
|
||||
if (!this.useVirtualList && (this.filterTerms.length === 0)) {
|
||||
const nodeArray = this.fileTree.toArray();
|
||||
const filteredRows = nodeArray.map(node => this.getRow(node));
|
||||
return filteredRows;
|
||||
|
||||
@@ -74,6 +74,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
||||
const new_hash = torrentsTable.getCurrentTorrentID();
|
||||
if (new_hash === "") {
|
||||
torrentFilesTable.clear();
|
||||
current_hash = "";
|
||||
clearTimeout(loadTorrentFilesDataTimer);
|
||||
return;
|
||||
}
|
||||
@@ -176,6 +177,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
||||
|
||||
const clear = () => {
|
||||
torrentFilesTable.clear();
|
||||
current_hash = "";
|
||||
};
|
||||
|
||||
return exports();
|
||||
|
||||
Reference in New Issue
Block a user