|
|
@ -3393,32 +3393,35 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
var titleBackup = document.title, |
|
|
|
var titleBackup = document.title, |
|
|
|
titlePromise; |
|
|
|
titlePromise; |
|
|
|
|
|
|
|
|
|
|
|
$rootScope.$watch('idle.isIDLE', function (newVal) { |
|
|
|
$rootScope.$watch('idle.isIDLE', function (newVal) { |
|
|
|
// console.log('isIDLE watch', newVal);
|
|
|
|
if (!newVal) { |
|
|
|
$interval.cancel(titlePromise); |
|
|
|
notificationsClear(); |
|
|
|
|
|
|
|
} |
|
|
|
if (!newVal) { |
|
|
|
if (!Config.Navigator.mobile) { |
|
|
|
document.title = titleBackup; |
|
|
|
$interval.cancel(titlePromise); |
|
|
|
$('link[rel="icon"]:first').replaceWith(faviconBackupEl); |
|
|
|
if (!newVal) { |
|
|
|
notificationsClear(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
titleBackup = document.title; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
titlePromise = $interval(function () { |
|
|
|
|
|
|
|
var time = tsNow(); |
|
|
|
|
|
|
|
if (!notificationsCount || time % 2000 > 1000) { |
|
|
|
|
|
|
|
document.title = titleBackup; |
|
|
|
document.title = titleBackup; |
|
|
|
var curFav = $('link[rel="icon"]:first'); |
|
|
|
$('link[rel="icon"]:first').replaceWith(faviconBackupEl); |
|
|
|
if (curFav.attr('href').indexOf('favicon_unread') != -1) { |
|
|
|
|
|
|
|
curFav.replaceWith(faviconBackupEl); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
document.title = langNotificationsPluralize(notificationsCount); |
|
|
|
titleBackup = document.title; |
|
|
|
$('link[rel="icon"]:first').replaceWith(faviconNewEl); |
|
|
|
|
|
|
|
|
|
|
|
titlePromise = $interval(function () { |
|
|
|
|
|
|
|
var time = tsNow(); |
|
|
|
|
|
|
|
if (!notificationsCount || time % 2000 > 1000) { |
|
|
|
|
|
|
|
document.title = titleBackup; |
|
|
|
|
|
|
|
var curFav = $('link[rel="icon"]:first'); |
|
|
|
|
|
|
|
if (curFav.attr('href').indexOf('favicon_unread') != -1) { |
|
|
|
|
|
|
|
curFav.replaceWith(faviconBackupEl); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
document.title = langNotificationsPluralize(notificationsCount); |
|
|
|
|
|
|
|
$('link[rel="icon"]:first').replaceWith(faviconNewEl); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$rootScope.$on('apiUpdate', function (e, update) { |
|
|
|
$rootScope.$on('apiUpdate', function (e, update) { |
|
|
|
// console.log('on apiUpdate', update);
|
|
|
|
// console.log('on apiUpdate', update);
|
|
|
|