blob: 0866b4b72483a32c19c0723291cf2c1b2a79448c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/**
* ownCloud - News
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2014
*/
app.directive('newsTitleUnreadCount', 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];
}
});
}
};
});
|