summaryrefslogtreecommitdiffstats
path: root/js/build
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-31 01:34:08 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-31 01:34:08 +0200
commit0675405a8cb0a35797e4f0b96bd9072986bd1507 (patch)
treef8cd6825daa2cdd12d00be5ea3bcfe3b3c289225 /js/build
parent82f0a877a001ead0bd0cdd76d96fe46a071535d8 (diff)
show unreadcount in title
Diffstat (limited to 'js/build')
-rw-r--r--js/build/app.js27
1 files changed, 23 insertions, 4 deletions
diff --git a/js/build/app.js b/js/build/app.js
index 9d544268f..33c8b6ae3 100644
--- a/js/build/app.js
+++ b/js/build/app.js
@@ -369,16 +369,16 @@ var $__build_47_app__ = function () {
return false;
};
this.isSubscriptionsActive = function () {
- return $route.current.$$route.type === FEED_TYPE.SUBSCRIPTIONS;
+ return $route.current && $route.current.$$route.type === FEED_TYPE.SUBSCRIPTIONS;
};
this.isStarredActive = function () {
- return $route.current.$$route.type === FEED_TYPE.STARRED;
+ return $route.current && $route.current.$$route.type === FEED_TYPE.STARRED;
};
this.isFolderActive = function (folderId) {
- return $route.current.$$route.type === FEED_TYPE.FOLDER && $route.current.params.id === folderId;
+ return $route.current && $route.current.$$route.type === FEED_TYPE.FOLDER && $route.current.params.id === folderId;
};
this.isFeedActive = function (feedId) {
- return $route.current.$$route.type === FEED_TYPE.FEED && $route.current.params.id === feedId;
+ return $route.current && $route.current.$$route.type === FEED_TYPE.FEED && $route.current.params.id === feedId;
};
this.isAddingFolder = function () {
return true;
@@ -1750,6 +1750,25 @@ var $__build_47_app__ = function () {
};
}
]);
+ app.directive('newsTitleUnreadCount', [
+ '$window',
+ function ($window) {
+ 'use strict';
+ var baseTitle = $window.document.title;
+ return {
+ restrict: 'E',
+ scope: { unreadCount: '@' },
+ link: function (scope, elem, attrs) {
+ attrs.$observe('unreadCount', function (value) {
+ var titles = baseTitle.split('-');
+ if (value !== '0') {
+ $window.document.title = titles[0] + '(' + value + ') - ' + titles[1];
+ }
+ });
+ }
+ };
+ }
+ ]);
app.directive('newsTooltip', function () {
'use strict';
return function (scope, elem) {