commit
38ac95c863
|
@ -499,21 +499,25 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
// Check if we should show nicklist or not
|
// Check if we should show nicklist or not
|
||||||
$scope.showNicklist = $scope.updateShowNicklist();
|
$scope.showNicklist = $scope.updateShowNicklist();
|
||||||
});
|
});
|
||||||
|
$scope.favico = new Favico({animation: 'none'});
|
||||||
$rootScope.$on('notificationChanged', function() {
|
$rootScope.$on('notificationChanged', function() {
|
||||||
var notifications = _.reduce(models.model.buffers, function(memo, num) { return (parseInt(memo)||0) + num.notification;});
|
var notifications = _.reduce(models.model.buffers, function(memo, num) { return (parseInt(memo)||0) + num.notification;});
|
||||||
if (notifications > 0 ) {
|
if (typeof(notifications) !== 'number') return;
|
||||||
$scope.favico = new Favico({
|
if (notifications > 0) {
|
||||||
animation:'none'
|
$scope.favico.badge(notifications, {
|
||||||
|
bgColor: '#d00',
|
||||||
|
textColor: '#fff'
|
||||||
});
|
});
|
||||||
$scope.favico.badge(notifications);
|
} else {
|
||||||
}else {
|
|
||||||
var unread = _.reduce(models.model.buffers, function(memo, num) { return (parseInt(memo)||0) + num.unread;});
|
var unread = _.reduce(models.model.buffers, function(memo, num) { return (parseInt(memo)||0) + num.unread;});
|
||||||
$scope.favico = new Favico({
|
if (unread === 0) {
|
||||||
animation:'none',
|
$scope.favico.reset();
|
||||||
bgColor : '#5CB85C',
|
} else {
|
||||||
textColor : '#ff0'
|
$scope.favico.badge(unread, {
|
||||||
|
bgColor: '#5CB85C',
|
||||||
|
textColor: '#ff0'
|
||||||
});
|
});
|
||||||
$scope.favico.badge(unread);
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue