diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 0f3fcf6d..9c52b21b 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -79,7 +79,7 @@ module.controller('SubscribeCtrl', function($scope, SubscriptionService) { }); module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams, - $location, $state, $route, SubscriptionService) { + $window, $location, $state, $route, SubscriptionService) { $scope.$on('$stateChangeSuccess', function() { $scope.selectedType = $stateParams._type; @@ -110,6 +110,18 @@ module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams, } return count; }; + + var rootUnreadCount = function() { + return unreadCount($scope.SubscriptionService.subscriptions) + }; + + $scope.$watch(rootUnreadCount, function(value) { + var label = 'CommaFeed'; + if (value > 0) { + label += ' (' + value + ')'; + } + $window.document.title = label; + }); $scope.formatCategoryName = function(category) { var count = unreadCount(category); @@ -494,10 +506,11 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) { }; }); -module.controller('ManageSettingsCtrl', function($scope, $location, AdminSettingsService) { - +module.controller('ManageSettingsCtrl', function($scope, $location, + AdminSettingsService) { + $scope.settings = AdminSettingsService.get(); - + $scope.cancel = function() { $location.path('/'); };