mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 14:23:35 -07:00
WebUI: Update sort icon after changing column order
This commit is contained in:
parent
ad9100ac07
commit
b58c3714ba
1 changed files with 9 additions and 8 deletions
|
@ -89,7 +89,6 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||||
this.setupCommonEvents();
|
this.setupCommonEvents();
|
||||||
this.setupHeaderEvents();
|
this.setupHeaderEvents();
|
||||||
this.setupHeaderMenu();
|
this.setupHeaderMenu();
|
||||||
this.setSortedColumnIcon(this.sortedColumn, null, (this.reverseSort === "1"));
|
|
||||||
this.setupAltRow();
|
this.setupAltRow();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -600,20 +599,22 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||||
updateTableHeaders: function() {
|
updateTableHeaders: function() {
|
||||||
this.updateHeader(this.hiddenTableHeader);
|
this.updateHeader(this.hiddenTableHeader);
|
||||||
this.updateHeader(this.fixedTableHeader);
|
this.updateHeader(this.fixedTableHeader);
|
||||||
|
this.setSortedColumnIcon(this.sortedColumn, null, (this.reverseSort === "1"));
|
||||||
},
|
},
|
||||||
|
|
||||||
updateHeader: function(header) {
|
updateHeader: function(header) {
|
||||||
const ths = this.getRowCells(header);
|
const ths = this.getRowCells(header);
|
||||||
for (let i = 0; i < ths.length; ++i) {
|
for (let i = 0; i < ths.length; ++i) {
|
||||||
const th = ths[i];
|
const th = ths[i];
|
||||||
th._this = this;
|
if (th.columnName !== this.columns[i].name) {
|
||||||
th.title = this.columns[i].caption;
|
th.title = this.columns[i].caption;
|
||||||
th.textContent = this.columns[i].caption;
|
th.textContent = this.columns[i].caption;
|
||||||
th.style.cssText = `width: ${this.columns[i].width}px; ${this.columns[i].style}`;
|
th.style.cssText = `width: ${this.columns[i].width}px; ${this.columns[i].style}`;
|
||||||
th.columnName = this.columns[i].name;
|
th.columnName = this.columns[i].name;
|
||||||
th.classList.add(`column_${th.columnName}`);
|
th.className = `column_${th.columnName}`;
|
||||||
th.classList.toggle("invisible", ((this.columns[i].visible === "0") || this.columns[i].force_hide));
|
th.classList.toggle("invisible", ((this.columns[i].visible === "0") || this.columns[i].force_hide));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getColumnPos: function(columnName) {
|
getColumnPos: function(columnName) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue