Skip to content

Commit

Permalink
WebUI: Maintain row selection after rearranging table columns
Browse files Browse the repository at this point in the history
  • Loading branch information
skomerko committed Feb 26, 2025
1 parent 6e1b5ec commit 2301bd4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/webui/www/private/scripts/dynamicTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.updateTableHeaders();
this.tableBody.replaceChildren();
this.updateTable(true);
this.reselectRows(this.selectedRowsIds());
}
if (this.currentHeaderAction === "drag") {
resetElementBorderStyle(el);
Expand Down Expand Up @@ -751,10 +752,7 @@ window.qBittorrent.DynamicTable ??= (() => {
reselectRows: function(rowIds) {
this.deselectAll();
this.selectedRows = rowIds.slice();
for (const tr of this.getTrs()) {
if (rowIds.includes(tr.rowId))
tr.classList.add("selected");
}
this.setRowClass();
},

setRowClass: function() {
Expand Down

0 comments on commit 2301bd4

Please sign in to comment.