diff options
-rw-r--r-- | js/controller/NavigationController.js | 5 | ||||
-rw-r--r-- | js/service/ItemResource.js | 10 | ||||
-rw-r--r-- | templates/part.navigation.sharedfeed.php | 4 |
3 files changed, 16 insertions, 3 deletions
diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js index 2483fbd00..191618504 100644 --- a/js/controller/NavigationController.js +++ b/js/controller/NavigationController.js @@ -113,6 +113,10 @@ app.controller('NavigationController', function ($route, FEED_TYPE, FeedResource return this.getStarredCount() > 0; }; + this.getSharedCount = function () { + return ItemResource.getSharedCount(); + }; + this.isSharedUnread = function () { return true; // TODO:: waiting for Nicolas' request to receive the number of shared articles //return this.getSharedCount() > 0; @@ -156,7 +160,6 @@ app.controller('NavigationController', function ($route, FEED_TYPE, FeedResource }; this.isSharedActive = function () { - console.log('hey i\'m : ' + $route.current.$$route.type); return $route.current && $route.current.$$route.type === FEED_TYPE.SHARED; }; diff --git a/js/service/ItemResource.js b/js/service/ItemResource.js index fcfd2f28d..e0b19152a 100644 --- a/js/service/ItemResource.js +++ b/js/service/ItemResource.js @@ -20,6 +20,7 @@ app.factory('ItemResource', function (Resource, $http, BASE_URL, ITEM_BATCH_SIZE ItemResource.prototype.clear = function () { this.starredCount = 0; + this.sharedCount = 0; this.lowestId = 0; this.highestId = 0; this.fingerprints = {}; @@ -36,6 +37,10 @@ app.factory('ItemResource', function (Resource, $http, BASE_URL, ITEM_BATCH_SIZE this.starredCount = value; break; + case 'shared': + this.sharedCount = value; + break; + default: var self = this; var importValues = []; @@ -77,6 +82,11 @@ app.factory('ItemResource', function (Resource, $http, BASE_URL, ITEM_BATCH_SIZE }; + ItemResource.prototype.getSharedCount = function () { + return this.sharedCount; + }; + + ItemResource.prototype.star = function (itemId, isStarred) { if (isStarred === undefined) { isStarred = true; diff --git a/templates/part.navigation.sharedfeed.php b/templates/part.navigation.sharedfeed.php index ee4bb4fc3..6767b407b 100644 --- a/templates/part.navigation.sharedfeed.php +++ b/templates/part.navigation.sharedfeed.php @@ -12,8 +12,8 @@ <ul> <li class="app-navigation-entry-utils-counter" ng-show="Navigation.isSharedUnread()" - title="{{ Navigation.getStarredCount() }}"> - {{ Navigation.getStarredCount() | unreadCountFormatter }} + title="{{ Navigation.getSharedCount() }}"> + {{ Navigation.getSharedCount() | unreadCountFormatter }} </li> </ul> </div> |