exception_error("catchupFeed", e);
}
}
+
+function decrementFeedCounter(feed, is_cat) {
+ try {
+ var ctr = getFeedUnread(feed, is_cat);
+
+ if (ctr > 0) {
+ setFeedUnread(feed, is_cat, ctr - 1);
+
+ if (!is_cat) {
+ var cat = parseInt(getFeedCategory(feed));
+
+ if (!isNaN(cat)) {
+ ctr = getFeedUnread(cat, true);
+
+ if (ctr > 0) {
+ setFeedUnread(cat, true, ctr - 1);
+ }
+ }
+ }
+ }
+
+ } catch (e) {
+ exception_error("decrement_feed_counter", e);
+ }
+}
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);
- }
- }
- }
+ decrementFeedCounter(getActiveFeedId(), activeFeedIsCat());
}
new Ajax.Request("backend.php", {
toggleSelected(id);
var elem = $("RROW-" + id);
+ var article_is_unread = elem.hasClassName("Unread");
if (elem)
elem.removeClassName("Unread");
active_post_id = id;
+ if (article_is_unread) {
+ decrementFeedCounter(getActiveFeedId(), activeFeedIsCat());
+ }
+
var query = "?op=rpc&method=catchupSelected" +
"&cmode=0&ids=" + param_escape(id);
} else {
toggleSelected(id, true);
+
+ var elem = $("RROW-" + id);
+ var article_is_unread = elem.hasClassName("Unread");
+
+ if (article_is_unread) {
+ decrementFeedCounter(getActiveFeedId(), activeFeedIsCat());
+ }
+
toggleUnread(id, 0, false);
zoomToArticle(event, id);
}