diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-05 23:15:25 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-05 23:15:25 +0200 |
commit | 27f34bcb4b774d291c03889024e03bb36b0e19b9 (patch) | |
tree | 46cc78548af53f693b3939317de8a0412bca009d /js/app/services/bl/feedbl.coffee | |
parent | 2d8f76d28f47bc3992c0e86c194fe51427805b54 (diff) |
reload page after showall has been changed
Diffstat (limited to 'js/app/services/bl/feedbl.coffee')
-rw-r--r-- | js/app/services/bl/feedbl.coffee | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/js/app/services/bl/feedbl.coffee b/js/app/services/bl/feedbl.coffee index 088f2e623..77b3d81e2 100644 --- a/js/app/services/bl/feedbl.coffee +++ b/js/app/services/bl/feedbl.coffee @@ -23,13 +23,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').factory 'FeedBl', ['_Bl', 'ShowAll', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', -'FeedModel', -(_Bl, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel) -> +'FeedModel', 'NewLoading', +(_Bl, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel, +NewLoading) -> class FeedBl extends _Bl constructor: (@_showAll, @_feedModel, persistence, activeFeed, feedType, - itemModel) -> + itemModel, @_newLoading) -> super(activeFeed, persistence, itemModel, feedType.Feed) @@ -92,15 +93,22 @@ angular.module('News').factory 'FeedBl', setShowAll: (showAll) -> @_showAll.setShowAll(showAll) - @_persistence.getItems( - @_activeFeed.getType(), - @_activeFeed.getId(), - 0 - ) + + # TODO: this callback is not tested with a unittest + callback = => + @_itemModel.clear() + @_newLoading.increase() + @_persistence.getItems( + @_activeFeed.getType(), + @_activeFeed.getId(), + 0, + => + @_newLoading.decrease() + ) if showAll - @_persistence.userSettingsReadShow() + @_persistence.userSettingsReadShow(callback) else - @_persistence.userSettingsReadHide() + @_persistence.userSettingsReadHide(callback) isShowAll: -> @@ -112,6 +120,6 @@ angular.module('News').factory 'FeedBl', return new FeedBl(ShowAll, FeedModel, Persistence, ActiveFeed, FeedType, - ItemModel) + ItemModel, NewLoading) ]
\ No newline at end of file |