diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-11 14:32:59 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-11 14:32:59 +0200 |
commit | 793bd2177367c32d205c19950be33a8afc3c76e1 (patch) | |
tree | 7a36495ecb43e998e95dd21ec60ce943338ad80c /js/controller/ContentController.js | |
parent | ea9ebd4826fe9807af5bc17e786b3dc58f163970 (diff) |
port to ES5, fix unread count going into minus
Diffstat (limited to 'js/controller/ContentController.js')
-rw-r--r-- | js/controller/ContentController.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js index ae265f2cf..e09279b25 100644 --- a/js/controller/ContentController.js +++ b/js/controller/ContentController.js @@ -39,7 +39,7 @@ function (Publisher, FeedResource, ItemResource, SettingsResource, data, this.markRead = function (itemId) { var item = ItemResource.get(itemId); - if (!item.keepUnread) { + if (!item.keepUnread && item.unread === true) { ItemResource.markItemRead(itemId); FeedResource.markItemOfFeedRead(item.feedId); } @@ -61,9 +61,9 @@ function (Publisher, FeedResource, ItemResource, SettingsResource, data, this.orderBy = function () { if (SettingsResource.get('oldestFirst')) { - return 'id'; - } else { return '-id'; + } else { + return 'id'; } }; @@ -101,14 +101,15 @@ function (Publisher, FeedResource, ItemResource, SettingsResource, data, var type = $route.current.$$route.type; var id = $routeParams.id; + var self = this; ItemResource.autoPage(type, id).success(function (data) { Publisher.publishAll(data); if (data.items.length > 0) { - this.isAutoPagingEnabled = true; + self.isAutoPagingEnabled = true; } }).error(function () { - this.isAutoPagingEnabled = true; + self.isAutoPagingEnabled = true; }); }; |