diff options
author | Andrew Dolgov <[email protected]> | 2012-04-04 15:34:06 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-04-04 15:34:06 +0400 |
commit | 6c8e8fbdc9a9a9ee0412a0f36698fd03a2954839 (patch) | |
tree | 7d9f0a7576c42e244d695f8e6c6f960f61280c6e /js/viewfeed.js | |
parent | 21e42e5fb08555f71fd6aefa34be80ddf43aef06 (diff) |
view: implement a hack to fake counter updates for current feed and its parent
Diffstat (limited to 'js/viewfeed.js')
-rw-r--r-- | js/viewfeed.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js index aac5019b1..4e610ca10 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -391,6 +391,24 @@ function view(id) { console.log(query); + if (article_is_unread) { + var ctr = getFeedUnread(getActiveFeedId(), activeFeedIsCat()); + + if (ctr > 0) { + setFeedUnread(getActiveFeedId(), activeFeedIsCat(), ctr - 1); + + var cat = parseInt(getFeedCategory(getActiveFeedId())); + + if (!isNaN(cat)) { + ctr = getFeedUnread(cat, true); + + if (ctr > 0) { + setFeedUnread(cat, true, ctr - 1); + } + } + } + } + new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { |