mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Defer to base class for redundant logic
This ensures these tables only contain their unique logic.
This commit is contained in:
parent
dbd19b314f
commit
81bbd1c5bd
1 changed files with 7 additions and 30 deletions
|
@ -3272,18 +3272,14 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
}
|
||||
updateRow(tr, fullUpdate) {
|
||||
const row = this.rows.get(tr.rowId);
|
||||
const data = row[fullUpdate ? "full_data" : "data"];
|
||||
|
||||
const tds = this.getRowCells(tr);
|
||||
for (let i = 0; i < this.columns.length; ++i) {
|
||||
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||
this.columns[i].updateTd(tds[i], row);
|
||||
}
|
||||
row["data"] = {};
|
||||
|
||||
tds[0].style.overflow = "visible";
|
||||
const indentation = row.full_data.indentation;
|
||||
tds[0].style.paddingLeft = `${indentation * 32 + 4}px`;
|
||||
tds[1].style.paddingLeft = `${indentation * 32 + 4}px`;
|
||||
|
||||
return super.updateRow(tr, fullUpdate);
|
||||
}
|
||||
updateIcons() {
|
||||
// state_icon
|
||||
|
@ -3408,15 +3404,9 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
}
|
||||
updateRow(tr, fullUpdate) {
|
||||
const row = this.rows.get(tr.rowId);
|
||||
const data = row[fullUpdate ? "full_data" : "data"];
|
||||
tr.classList.toggle("unreadArticle", !row.full_data.isRead);
|
||||
|
||||
const tds = this.getRowCells(tr);
|
||||
for (let i = 0; i < this.columns.length; ++i) {
|
||||
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||
this.columns[i].updateTd(tds[i], row);
|
||||
}
|
||||
row["data"] = {};
|
||||
return super.updateRow(tr, fullUpdate);
|
||||
}
|
||||
newColumn(name, style, caption, defaultWidth, defaultVisible) {
|
||||
const column = {};
|
||||
|
@ -3673,23 +3663,10 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
selectRow() {}
|
||||
updateRow(tr, fullUpdate) {
|
||||
const row = this.rows.get(tr.rowId);
|
||||
const data = row[fullUpdate ? "full_data" : "data"];
|
||||
tr.classList.toggle("articleTableFeed", row.full_data.isFeed);
|
||||
tr.classList.toggle("articleTableArticle", !row.full_data.isFeed);
|
||||
|
||||
if (row.full_data.isFeed) {
|
||||
tr.classList.add("articleTableFeed");
|
||||
tr.classList.remove("articleTableArticle");
|
||||
}
|
||||
else {
|
||||
tr.classList.remove("articleTableFeed");
|
||||
tr.classList.add("articleTableArticle");
|
||||
}
|
||||
|
||||
const tds = this.getRowCells(tr);
|
||||
for (let i = 0; i < this.columns.length; ++i) {
|
||||
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||
this.columns[i].updateTd(tds[i], row);
|
||||
}
|
||||
row["data"] = {};
|
||||
return super.updateRow(tr, fullUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue