diff options
author | Andrew Dolgov <[email protected]> | 2018-12-10 16:10:19 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-10 16:10:19 +0300 |
commit | f96cdb7d5d79f60885cdebc94497c0618f5fe4a5 (patch) | |
tree | b0e57d8f045e1399fc733220783106fd53d498c4 | |
parent | 109910424c2ed084d226980e0bdc60578697268e (diff) |
renderAgain flag fixes
-rwxr-xr-x | js/Headlines.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/js/Headlines.js b/js/Headlines.js index 7564d48dd..bb2eb398b 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -238,12 +238,15 @@ define(["dojo/_base/declare"], function (declare) { return this.headlines[id]; }, renderAgain: function() { + // TODO: wrap headline elements into a knockoutjs model to prevent all this stuff + $$("#headlines-frame > div[id*=RROW]").each((row) => { const id = row.getAttribute("data-article-id"); const selected = row.hasClassName("Selected"); const active = row.hasClassName("active"); const marked = row.hasClassName("marked"); const published = row.hasClassName("published"); + const unread = row.hasClassName("Unread"); if (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 (marked) new_row.addClassName("marked"); - if (published) new_row.addClassName("published"); + if (marked) + 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); |