From d48d621cc8511c1e8fc37b9a45352ca08935e9be Mon Sep 17 00:00:00 2001 From: skomerko <168652295+skomerko@users.noreply.github.com> Date: Sun, 23 Feb 2025 16:45:23 +0100 Subject: [PATCH] WebUI: Maintain row highlight after rearranging table columns --- src/webui/www/private/scripts/dynamicTable.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index ab9772a9d..f5f5ff122 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -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); @@ -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() {