Merge pull request #575 from stenehall/count-in-topbar
Add notification and unread count to topbar
This commit is contained in:
commit
41ce296e83
3 changed files with 10 additions and 0 deletions
|
@ -220,6 +220,9 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
|
||||||
<a href="#" ng-click="toggleSidebar()">
|
<a href="#" ng-click="toggleSidebar()">
|
||||||
<img alt="brand" src="assets/img/favicon.png" title="Connected to {{ settings.host }}:{{ settings.port}}">
|
<img alt="brand" src="assets/img/favicon.png" title="Connected to {{ settings.host }}:{{ settings.port}}">
|
||||||
</a>
|
</a>
|
||||||
|
<span class="badge" ng-show="unread > 0">{{unread}}</span>
|
||||||
|
<span class="badge danger" ng-show="notifications > 0">{{notifications}}</span>
|
||||||
|
|
||||||
<button ng-if="debugMode" ng-click="countWatchers()">Count<br />Watchers</button>
|
<button ng-if="debugMode" ng-click="countWatchers()">Count<br />Watchers</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
notifications.updateTitle(ab);
|
notifications.updateTitle(ab);
|
||||||
|
$scope.notifications = notifications.unreadCount('notification');
|
||||||
|
$scope.unread = notifications.unreadCount('unread');
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.scrollWithBuffer(true);
|
$rootScope.scrollWithBuffer(true);
|
||||||
|
@ -233,9 +235,13 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.favico = new Favico({animation: 'none'});
|
$rootScope.favico = new Favico({animation: 'none'});
|
||||||
|
$scope.notifications = notifications.unreadCount('notification');
|
||||||
|
$scope.unread = notifications.unreadCount('unread');
|
||||||
|
|
||||||
$rootScope.$on('notificationChanged', function() {
|
$rootScope.$on('notificationChanged', function() {
|
||||||
notifications.updateTitle();
|
notifications.updateTitle();
|
||||||
|
$scope.notifications = notifications.unreadCount('notification');
|
||||||
|
$scope.unread = notifications.unreadCount('unread');
|
||||||
|
|
||||||
if (settings.useFavico && $rootScope.favico) {
|
if (settings.useFavico && $rootScope.favico) {
|
||||||
notifications.updateFavico();
|
notifications.updateFavico();
|
||||||
|
|
|
@ -157,5 +157,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu
|
||||||
updateFavico: updateFavico,
|
updateFavico: updateFavico,
|
||||||
createHighlight: createHighlight,
|
createHighlight: createHighlight,
|
||||||
cancelAll: cancelAll,
|
cancelAll: cancelAll,
|
||||||
|
unreadCount: unreadCount
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
Loading…
Reference in a new issue