Skip to content

Commit

Permalink
WebUI: Access element attribute/property natively in log tables
Browse files Browse the repository at this point in the history
#21007 changed pretty much everything already but I spotted some leftovers and replaced them too.

PR #22294.
  • Loading branch information
skomerko authored Feb 21, 2025
1 parent a9b54d9 commit 1ca33d4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/webui/www/private/scripts/dynamicTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3262,7 +3262,8 @@ window.qBittorrent.DynamicTable ??= (() => {
initColumnsFunctions: function() {
this.columns["timestamp"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
td.set({ text: date, title: date });
td.textContent = date;
td.title = date;
};

this.columns["type"].updateTd = function(td, row) {
Expand Down Expand Up @@ -3290,7 +3291,8 @@ window.qBittorrent.DynamicTable ??= (() => {
addClass = "logUnknown";
break;
}
td.set({ text: logLevel, title: logLevel });
td.textContent = logLevel;
td.title = logLevel;
td.closest("tr").className = `logTableRow${addClass}`;
};
},
Expand Down Expand Up @@ -3337,7 +3339,8 @@ window.qBittorrent.DynamicTable ??= (() => {

this.columns["timestamp"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
td.set({ text: date, title: date });
td.textContent = date;
td.title = date;
};

this.columns["blocked"].updateTd = function(td, row) {
Expand All @@ -3350,7 +3353,8 @@ window.qBittorrent.DynamicTable ??= (() => {
status = "QBT_TR(Banned)QBT_TR[CONTEXT=ExecutionLogWidget]";
addClass = "peerBanned";
}
td.set({ text: status, title: status });
td.textContent = status;
td.title = status;
td.closest("tr").className = `logTableRow${addClass}`;
};
},
Expand Down

0 comments on commit 1ca33d4

Please sign in to comment.