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)
|
for (const [key, _] of this.collapseState)
|
||||||
this.expandNode(key);
|
this.expandNode(key);
|
||||||
|
|
||||||
|
if (this.useVirtualList)
|
||||||
|
this.rerender();
|
||||||
}
|
}
|
||||||
|
|
||||||
collapseAllNodes() {
|
collapseAllNodes() {
|
||||||
@@ -2370,6 +2373,9 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||||||
if (state.depth >= 1)
|
if (state.depth >= 1)
|
||||||
this.collapseNode(key);
|
this.collapseNode(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.useVirtualList)
|
||||||
|
this.rerender();
|
||||||
}
|
}
|
||||||
|
|
||||||
#updateNodeVisibility(node, shouldHide) {
|
#updateNodeVisibility(node, shouldHide) {
|
||||||
@@ -2741,8 +2747,10 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||||||
|
|
||||||
generateRowsSignature() {
|
generateRowsSignature() {
|
||||||
const rowsData = [];
|
const rowsData = [];
|
||||||
for (const { rowId } of this.getRowValues())
|
for (const { rowId } of this.getRowValues()) {
|
||||||
rowsData.push({ ...this.getNode(rowId).serialize(), collapsed: this.isCollapsed(rowId) });
|
const node = this.getNode(rowId);
|
||||||
|
rowsData.push({ ...node.serialize(), collapsed: this.isCollapsed(node.rowId) });
|
||||||
|
}
|
||||||
return JSON.stringify(rowsData);
|
return JSON.stringify(rowsData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2771,7 +2779,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||||||
// sort, then filter
|
// sort, then filter
|
||||||
this.#sortNodesByColumn(root, this.columns[this.sortedColumn]);
|
this.#sortNodesByColumn(root, this.columns[this.sortedColumn]);
|
||||||
const rows = (() => {
|
const rows = (() => {
|
||||||
if (this.filterTerms.length === 0) {
|
if (!this.useVirtualList && (this.filterTerms.length === 0)) {
|
||||||
const nodeArray = this.fileTree.toArray();
|
const nodeArray = this.fileTree.toArray();
|
||||||
const filteredRows = nodeArray.map(node => this.getRow(node));
|
const filteredRows = nodeArray.map(node => this.getRow(node));
|
||||||
return filteredRows;
|
return filteredRows;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
|||||||
const new_hash = torrentsTable.getCurrentTorrentID();
|
const new_hash = torrentsTable.getCurrentTorrentID();
|
||||||
if (new_hash === "") {
|
if (new_hash === "") {
|
||||||
torrentFilesTable.clear();
|
torrentFilesTable.clear();
|
||||||
|
current_hash = "";
|
||||||
clearTimeout(loadTorrentFilesDataTimer);
|
clearTimeout(loadTorrentFilesDataTimer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -176,6 +177,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
|||||||
|
|
||||||
const clear = () => {
|
const clear = () => {
|
||||||
torrentFilesTable.clear();
|
torrentFilesTable.clear();
|
||||||
|
current_hash = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
return exports();
|
return exports();
|
||||||
|
|||||||
Reference in New Issue
Block a user