Defer to base class for redundant logic

This ensures these tables only contain their unique logic.
This commit is contained in:
Thomas Piccirello 2025-06-09 14:44:22 -07:00
commit 81bbd1c5bd
No known key found for this signature in database

View file

@ -3272,18 +3272,14 @@ window.qBittorrent.DynamicTable ??= (() => {
} }
updateRow(tr, fullUpdate) { updateRow(tr, fullUpdate) {
const row = this.rows.get(tr.rowId); const row = this.rows.get(tr.rowId);
const data = row[fullUpdate ? "full_data" : "data"];
const tds = this.getRowCells(tr); 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"; tds[0].style.overflow = "visible";
const indentation = row.full_data.indentation; const indentation = row.full_data.indentation;
tds[0].style.paddingLeft = `${indentation * 32 + 4}px`; tds[0].style.paddingLeft = `${indentation * 32 + 4}px`;
tds[1].style.paddingLeft = `${indentation * 32 + 4}px`; tds[1].style.paddingLeft = `${indentation * 32 + 4}px`;
return super.updateRow(tr, fullUpdate);
} }
updateIcons() { updateIcons() {
// state_icon // state_icon
@ -3408,15 +3404,9 @@ window.qBittorrent.DynamicTable ??= (() => {
} }
updateRow(tr, fullUpdate) { updateRow(tr, fullUpdate) {
const row = this.rows.get(tr.rowId); const row = this.rows.get(tr.rowId);
const data = row[fullUpdate ? "full_data" : "data"];
tr.classList.toggle("unreadArticle", !row.full_data.isRead); tr.classList.toggle("unreadArticle", !row.full_data.isRead);
const tds = this.getRowCells(tr); return super.updateRow(tr, fullUpdate);
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"] = {};
} }
newColumn(name, style, caption, defaultWidth, defaultVisible) { newColumn(name, style, caption, defaultWidth, defaultVisible) {
const column = {}; const column = {};
@ -3673,23 +3663,10 @@ window.qBittorrent.DynamicTable ??= (() => {
selectRow() {} selectRow() {}
updateRow(tr, fullUpdate) { updateRow(tr, fullUpdate) {
const row = this.rows.get(tr.rowId); 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) { return super.updateRow(tr, fullUpdate);
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"] = {};
} }
} }