summaryrefslogtreecommitdiff
path: root/js/Headlines.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-07 21:11:50 +0300
committerAndrew Dolgov <[email protected]>2018-12-07 21:11:50 +0300
commit8f75b06835aa714e57501efe9d82ec9ffc285a62 (patch)
tree2273a34929f775c6991adf6873e6edda64434631 /js/Headlines.js
parent1369124fe02c5ae1fad4837c6b1e5663715af40d (diff)
implement feed grouping display, remove unneeded server vgrlf passing
Diffstat (limited to 'js/Headlines.js')
-rwxr-xr-xjs/Headlines.js29
1 files changed, 24 insertions, 5 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index 376adbfd1..85467936c 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -248,6 +248,22 @@ define(["dojo/_base/declare"], function (declare) {
if (hl.published) row_class += " published";
if (hl.unread) row_class += " Unread";
+
+ if (headlines.vfeed_group_enabled && hl.feed_title && this.vgroup_last_feed != hl.feed_id) {
+ let vgrhdr = `<div data-feed-id='${hl.feed_id}' class='feed-title'>
+ <div style='float : right'>${hl.feed_icon}</div>
+ <a class="title" href="#" onclick="Feeds.open({feed:${hl.feed_id}})">${hl.feed_title}
+ <a class="catchup" onclick="Feeds.catchupFeedInGroup(${hl.feed_id})" href="#">${__('mark feed as read')}</a>
+ </div>`
+
+ const tmp = document.createElement("div");
+ tmp.innerHTML = vgrhdr;
+
+ $("headlines-frame").appendChild(tmp.firstChild);
+
+ this.vgroup_last_feed = hl.feed_id;
+ }
+
if (App.isCombinedMode()) {
row_class += App.getInitParam("cdm_expanded") ? " expanded" : " expandable";
@@ -343,11 +359,13 @@ define(["dojo/_base/declare"], function (declare) {
`;
}
- const tmp = document.createElement("div");
- tmp.innerHTML = row;
- dojo.parser.parse(tmp);
+ if (row != null) {
+ const tmp = document.createElement("div");
+ tmp.innerHTML = row;
+ dojo.parser.parse(tmp);
- $("headlines-frame").appendChild(tmp.firstChild);
+ $("headlines-frame").appendChild(tmp.firstChild);
+ }
},
onLoaded: function (transport, offset) {
const reply = App.handleRpcJson(transport);
@@ -390,11 +408,12 @@ define(["dojo/_base/declare"], function (declare) {
console.log('received', headlines_count, 'headlines, infscroll disabled=', Feeds.infscroll_disabled);
- this.vgroup_last_feed = reply['headlines-info']['vgroup_last_feed'];
+ //this.vgroup_last_feed = reply['headlines-info']['vgroup_last_feed'];
this.current_first_id = reply['headlines']['first_id'];
if (offset == 0) {
this.loaded_article_ids = [];
+ this.vgroup_last_feed = undefined;
dojo.html.set($("toolbar-headlines"),
reply['headlines']['toolbar'],