diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-16 15:19:05 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-16 15:23:12 +0200 |
commit | dee17d002d87667f7d0f4478e1f0180135618c38 (patch) | |
tree | d71c6896bd558b28fa16af0c424b2f4d1aca768c /js/app/services | |
parent | 8df6d36d49d89f3bb7186b36436606adb039b3f8 (diff) |
dont show unread count when it is 0, dont bold read feeds, implemented autopaging
Diffstat (limited to 'js/app/services')
-rw-r--r-- | js/app/services/businesslayer/itembusinesslayer.coffee | 7 | ||||
-rw-r--r-- | js/app/services/models/itemmodel.coffee | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/js/app/services/businesslayer/itembusinesslayer.coffee b/js/app/services/businesslayer/itembusinesslayer.coffee index b93f9035d..0b79cd638 100644 --- a/js/app/services/businesslayer/itembusinesslayer.coffee +++ b/js/app/services/businesslayer/itembusinesslayer.coffee @@ -105,7 +105,12 @@ StarredBusinessLayer) -> return feed.title - loadNext: -> + loadNext: (callback) -> + lowestItemId = @_itemModel.getLowestId() + if angular.isDefined(lowestItemId) + @_persistence.getItems @_activeFeed.getType(), + @_activeFeed.getId(), lowestItemId, + callback diff --git a/js/app/services/models/itemmodel.coffee b/js/app/services/models/itemmodel.coffee index 70b3a9f5c..1b03d65f8 100644 --- a/js/app/services/models/itemmodel.coffee +++ b/js/app/services/models/itemmodel.coffee @@ -109,5 +109,16 @@ angular.module('News').factory 'ItemModel', return 0 + getLowestId: -> + query = new _MinimumQuery('id') + lowestId = @get(query) + + if angular.isDefined(lowestId) + return lowestId.id + else + return 0 + + + return new ItemModel() ]
\ No newline at end of file |