(js) Insert unseen msgs count in window's title
parent
195d477149
commit
4c23f21ae1
1
NEWS
1
NEWS
|
@ -8,6 +8,7 @@ Enhancements
|
|||
- [web] don't allow a recurrence rule to end before the first occurrence
|
||||
- [web] updated Angular Material to version 1.1.0
|
||||
- [web] show user's name upon successful login
|
||||
- [web] inserted unseen messages count and mailbox name in browser's window title
|
||||
|
||||
Bug fixes
|
||||
- [eas] properly generate the BusyStatus for normal events
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
<var:if condition="hideFrame" const:negate="YES">
|
||||
<html const:xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" const:lang="en">
|
||||
<head>
|
||||
<title>
|
||||
<var:string value="title" />
|
||||
</title>
|
||||
<title var:sg-default="title"><var:string value="title"/></title>
|
||||
<meta name="hideFrame" var:content="hideFrame" />
|
||||
<meta name="description" content="SOGo Web Interface" />
|
||||
<meta name="author" content="Inverse inc." />
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
*/
|
||||
MailboxController.$inject = ['$window', '$scope', '$timeout', '$q', '$state', '$mdDialog', '$mdToast', 'stateAccounts', 'stateAccount', 'stateMailbox', 'encodeUriFilter', 'sgFocus', 'Dialog', 'Account', 'Mailbox'];
|
||||
function MailboxController($window, $scope, $timeout, $q, $state, $mdDialog, $mdToast, stateAccounts, stateAccount, stateMailbox, encodeUriFilter, focus, Dialog, Account, Mailbox) {
|
||||
var vm = this, messageDialog = null;
|
||||
var vm = this, messageDialog = null,
|
||||
defaultWindowTitle = angular.element($window.document).find('title').attr('sg-default') || "SOGo";
|
||||
|
||||
// Expose controller for eventual popup windows
|
||||
$window.$mailboxController = vm;
|
||||
|
@ -42,6 +43,15 @@
|
|||
angular.element($window).off('beforeunload', _compactBeforeUnload);
|
||||
});
|
||||
|
||||
// Update window's title with unseen messages count of selected mailbox
|
||||
$scope.$watch(function() { return vm.selectedFolder.unseenCount; }, function(unseenCount) {
|
||||
var title = defaultWindowTitle + ' - ';
|
||||
if (unseenCount)
|
||||
title += '(' + unseenCount + ') ';
|
||||
title += vm.selectedFolder.name;
|
||||
$window.document.title = title;
|
||||
});
|
||||
|
||||
function _compactBeforeUnload(event) {
|
||||
return vm.selectedFolder.$compact();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue