diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/Feeds.js | 4 | ||||
-rwxr-xr-x | js/Headlines.js | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/js/Feeds.js b/js/Feeds.js index 13b952d9a..42ab6fe7e 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -93,6 +93,8 @@ define(["dojo/_base/declare"], function (declare) { } } + Headlines.updateCurrentUnread(); + this.hideOrShowFeeds(App.getInitParam("hide_read_feeds")); this._counters_prev = elems; @@ -119,6 +121,8 @@ define(["dojo/_base/declare"], function (declare) { Element.visible("feeds-holder") ? splitter.show() : splitter.hide(); dijit.byId("main").resize(); + + Headlines.updateCurrentUnread(); }, cancelSearch: function() { this._search_query = ""; diff --git a/js/Headlines.js b/js/Headlines.js index 05de3a0e9..473a137f8 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -546,6 +546,16 @@ define(["dojo/_base/declare"], function (declare) { return tmp.firstChild; }, + updateCurrentUnread: function() { + const feed_unread = Feeds.getUnread(Feeds.getActive(), Feeds.activeIsCat()); + + if (feed_unread > 0 && !Element.visible("feeds-holder")) { + $("feed_current_unread").innerText = feed_unread; + Element.show("feed_current_unread"); + } else { + Element.hide("feed_current_unread"); + } + }, onLoaded: function (transport, offset, append) { const reply = App.handleRpcJson(transport); @@ -648,6 +658,8 @@ define(["dojo/_base/declare"], function (declare) { "</span>"; } + Headlines.updateCurrentUnread(); + } else if (headlines_count > 0 && feed_id == Feeds.getActive() && is_cat == Feeds.activeIsCat()) { const c = dijit.byId("headlines-frame"); |