diff options
Diffstat (limited to 'js/app')
-rw-r--r-- | js/app/controllers/controllers.coffee | 6 | ||||
-rw-r--r-- | js/app/controllers/itemcontroller.coffee | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/js/app/controllers/controllers.coffee b/js/app/controllers/controllers.coffee index a302b1033..41c272347 100644 --- a/js/app/controllers/controllers.coffee +++ b/js/app/controllers/controllers.coffee @@ -40,8 +40,8 @@ ShowAll, FeedType, StarredCount, Persistence, ItemModel)-> ] angular.module('News').controller 'ItemController', -['$scope', '_ItemController', 'ItemModel', 'FeedLoading', -($scope, _ItemController, ItemModel, FeedLoading)-> +['$scope', '_ItemController', 'ItemModel', 'FeedModel', 'FeedLoading', +($scope, _ItemController, ItemModel, FeedModel, FeedLoading)-> - return new _ItemController($scope, ItemModel, FeedLoading) + return new _ItemController($scope, ItemModel, FeedModel, FeedLoading) ]
\ No newline at end of file diff --git a/js/app/controllers/itemcontroller.coffee b/js/app/controllers/itemcontroller.coffee index c23d84e14..0a2c1229e 100644 --- a/js/app/controllers/itemcontroller.coffee +++ b/js/app/controllers/itemcontroller.coffee @@ -2,7 +2,7 @@ ownCloud - News -@author Bernhard Posselt +@_author Bernhard Posselt @copyright 2012 Bernhard Posselt nukeawhale@gmail.com This library is free software; you can redistribute it and/or @@ -25,12 +25,19 @@ angular.module('News').factory '_ItemController', -> class ItemController - constructor: (@$scope, @itemModel, @feedLoading) -> + constructor: (@_$scope, @_itemModel, @_feedModel, @_feedLoading) -> - @$scope.items = @itemModel.getAll() + @_$scope.items = @_itemModel.getAll() - @$scope.isLoading = => - return @feedLoading.isLoading() + @_$scope.isLoading = => + return @_feedLoading.isLoading() + + @_$scope.getFeedTitle = (feedId) => + feed = @_feedModel.getById(feedId) + if angular.isDefined(feed) + return feed.title + else + return '' return ItemController
\ No newline at end of file |