mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
WebUI: Maintain row highlight after rearranging table columns
This PR fixes a bug where row highlight effect would be lost after reordering columns. PR #22339.
This commit is contained in:
parent
c1defceccf
commit
964be0fa1c
1 changed files with 2 additions and 4 deletions
|
@ -294,6 +294,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);
|
||||||
|
@ -750,10 +751,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() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue