mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
WebUI: Update sort icon after changing column order
This PR fixes a bug where the sort icon did not update correctly after reordering columns. Steps to reproduce: 1. Sort a column 2. Move it to a different position 3. The sort icon remains in its original location PR #22299.
This commit is contained in:
parent
1ca33d45ba
commit
ba3d89b674
1 changed files with 9 additions and 8 deletions
|
@ -89,7 +89,6 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
this.setupCommonEvents();
|
||||
this.setupHeaderEvents();
|
||||
this.setupHeaderMenu();
|
||||
this.setSortedColumnIcon(this.sortedColumn, null, (this.reverseSort === "1"));
|
||||
this.setupAltRow();
|
||||
},
|
||||
|
||||
|
@ -600,19 +599,21 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
updateTableHeaders: function() {
|
||||
this.updateHeader(this.hiddenTableHeader);
|
||||
this.updateHeader(this.fixedTableHeader);
|
||||
this.setSortedColumnIcon(this.sortedColumn, null, (this.reverseSort === "1"));
|
||||
},
|
||||
|
||||
updateHeader: function(header) {
|
||||
const ths = this.getRowCells(header);
|
||||
for (let i = 0; i < ths.length; ++i) {
|
||||
const th = ths[i];
|
||||
th._this = this;
|
||||
th.title = this.columns[i].caption;
|
||||
th.textContent = this.columns[i].caption;
|
||||
th.style.cssText = `width: ${this.columns[i].width}px; ${this.columns[i].style}`;
|
||||
th.columnName = this.columns[i].name;
|
||||
th.classList.add(`column_${th.columnName}`);
|
||||
th.classList.toggle("invisible", ((this.columns[i].visible === "0") || this.columns[i].force_hide));
|
||||
if (th.columnName !== this.columns[i].name) {
|
||||
th.title = this.columns[i].caption;
|
||||
th.textContent = this.columns[i].caption;
|
||||
th.style.cssText = `width: ${this.columns[i].width}px; ${this.columns[i].style}`;
|
||||
th.columnName = this.columns[i].name;
|
||||
th.className = `column_${th.columnName}`;
|
||||
th.classList.toggle("invisible", ((this.columns[i].visible === "0") || this.columns[i].force_hide));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue