WebUI: Maintain row highlight after rearranging table columns

This commit is contained in:
skomerko 2025-02-23 16:45:23 +01:00
commit d48d621cc8

View file

@ -293,6 +293,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.updateTableHeaders(); this.updateTableHeaders();
this.tableBody.replaceChildren(); this.tableBody.replaceChildren();
this.updateTable(true); this.updateTable(true);
this.reselectRows(this.selectedRowsIds());
} }
if (this.currentHeaderAction === "drag") { if (this.currentHeaderAction === "drag") {
resetElementBorderStyle(el); resetElementBorderStyle(el);
@ -751,10 +752,7 @@ window.qBittorrent.DynamicTable ??= (() => {
reselectRows: function(rowIds) { reselectRows: function(rowIds) {
this.deselectAll(); this.deselectAll();
this.selectedRows = rowIds.slice(); this.selectedRows = rowIds.slice();
for (const tr of this.getTrs()) { this.setRowClass();
if (rowIds.includes(tr.rowId))
tr.classList.add("selected");
}
}, },
setRowClass: function() { setRowClass: function() {