From 7b2a214017097098ad1d020fe9b4a5c8b767486f Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 26 Mar 2013 19:48:55 +0100 Subject: show title and author below feed --- js/public/app.js | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'js/public') diff --git a/js/public/app.js b/js/public/app.js index 766317fd5..9efc9aece 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -155,8 +155,8 @@ License along with this library. If not, see . ]); angular.module('News').controller('ItemController', [ - '$scope', '_ItemController', 'ItemModel', 'FeedLoading', function($scope, _ItemController, ItemModel, FeedLoading) { - return new _ItemController($scope, ItemModel, FeedLoading); + '$scope', '_ItemController', 'ItemModel', 'FeedModel', 'FeedLoading', function($scope, _ItemController, ItemModel, FeedModel, FeedLoading) { + return new _ItemController($scope, ItemModel, FeedModel, FeedLoading); } ]); @@ -451,7 +451,7 @@ License along with this library. If not, see . 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 @@ -475,14 +475,24 @@ License along with this library. If not, see . var ItemController; ItemController = (function() { - function ItemController($scope, itemModel, feedLoading) { + function ItemController(_$scope, _itemModel, _feedModel, _feedLoading) { var _this = this; - this.$scope = $scope; - this.itemModel = itemModel; - this.feedLoading = feedLoading; - this.$scope.items = this.itemModel.getAll(); - this.$scope.isLoading = function() { - return _this.feedLoading.isLoading(); + this._$scope = _$scope; + this._itemModel = _itemModel; + this._feedModel = _feedModel; + this._feedLoading = _feedLoading; + this._$scope.items = this._itemModel.getAll(); + this._$scope.isLoading = function() { + return _this._feedLoading.isLoading(); + }; + this._$scope.getFeedTitle = function(feedId) { + var feed; + feed = _this._feedModel.getById(feedId); + if (angular.isDefined(feed)) { + return feed.title; + } else { + return ''; + } }; } -- cgit v1.2.3