1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:05:56 +00:00

renderAgain flag fixes

This commit is contained in:
Andrew Dolgov
2018-12-10 16:10:19 +03:00
parent 109910424c
commit f96cdb7d5d

View File

@@ -238,12 +238,15 @@ define(["dojo/_base/declare"], function (declare) {
return this.headlines[id]; return this.headlines[id];
}, },
renderAgain: function() { renderAgain: function() {
// TODO: wrap headline elements into a knockoutjs model to prevent all this stuff
$$("#headlines-frame > div[id*=RROW]").each((row) => { $$("#headlines-frame > div[id*=RROW]").each((row) => {
const id = row.getAttribute("data-article-id"); const id = row.getAttribute("data-article-id");
const selected = row.hasClassName("Selected"); const selected = row.hasClassName("Selected");
const active = row.hasClassName("active"); const active = row.hasClassName("active");
const marked = row.hasClassName("marked"); const marked = row.hasClassName("marked");
const published = row.hasClassName("published"); const published = row.hasClassName("published");
const unread = row.hasClassName("Unread");
if (this.headlines[id]) { if (this.headlines[id]) {
const new_row = this.render({}, this.headlines[id]); const new_row = this.render({}, this.headlines[id]);
@@ -261,8 +264,20 @@ define(["dojo/_base/declare"], function (declare) {
if (selected) this.select("all", id); if (selected) this.select("all", id);
if (marked) new_row.addClassName("marked"); if (marked)
if (published) new_row.addClassName("published"); new_row.addClassName("marked");
else
new_row.removeClassName("marked");
if (published)
new_row.addClassName("published");
else
new_row.removeClassName("published");
if (unread)
new_row.addClassName("Unread");
else
new_row.removeClassName("Unread");
Article.unpack(new_row); Article.unpack(new_row);