Only update title for notifications, not other kinds of activity

Also make the unread count the first thing in the title
This commit is contained in:
Lorenz Hübschle-Schneider 2014-02-21 10:22:27 +00:00
parent d4207ed7e0
commit df1bb08749
2 changed files with 4 additions and 8 deletions

View file

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<title ng-bind-template="WeeChat {{ pageTitle}}"></title> <title ng-bind-template="{{ notificationStatus }}WeeChat {{ pageTitle}}"></title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link rel="shortcut icon" sizes="128x128" href="img/weechat_logo_128x128.png"> <link rel="shortcut icon" sizes="128x128" href="img/weechat_logo_128x128.png">
<link rel="apple-touch-icon" sizes="128x128" href="img/weechat_logo_128x128.png"> <link rel="apple-touch-icon" sizes="128x128" href="img/weechat_logo_128x128.png">

View file

@ -548,17 +548,13 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
var notifications = $rootScope.unreadCount('notification'); var notifications = $rootScope.unreadCount('notification');
if (notifications > 0) { if (notifications > 0) {
// New notifications deserve an exclamation mark // New notifications deserve an exclamation mark
unreadFragment = '(' + notifications + '!) '; $rootScope.notificationStatus = '(' + notifications + ') ';
} else { } else {
// No notifications, look for unread messages instead $rootScope.notificationStatus = '';
var unread = $rootScope.unreadCount('unread');
if (unread > 0) {
unreadFragment = '(' + unread + ') ';
}
} }
var activeBuffer = models.getActiveBuffer(); var activeBuffer = models.getActiveBuffer();
$rootScope.pageTitle = unreadFragment + activeBuffer.shortName + ' | ' + activeBuffer.title; $rootScope.pageTitle = activeBuffer.shortName + ' | ' + activeBuffer.title;
}; };
$scope.updateFavico = function() { $scope.updateFavico = function() {