From f220ce0541468748dccb02483771a7dbf5a6abb6 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 19 Nov 2014 14:41:44 +0300 Subject: [PATCH] Fixed syntax --- app/js/services.js | 51 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index ee36843b..913c07ce 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -3393,35 +3393,34 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) var titleBackup = document.title, titlePromise; - $rootScope.$watch('idle.isIDLE', function (newVal) { + $rootScope.$watch('idle.isIDLE', function (newVal) { + if (!newVal) { + notificationsClear(); + } + if (!Config.Navigator.mobile) { + $interval.cancel(titlePromise); if (!newVal) { - notificationsClear(); - } - if (!Config.Navigator.mobile) { - $interval.cancel(titlePromise); - if (!newVal) { - document.title = titleBackup; - $('link[rel="icon"]:first').replaceWith(faviconBackupEl); - } else { - titleBackup = document.title; - - 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); + document.title = titleBackup; + $('link[rel="icon"]:first').replaceWith(faviconBackupEl); + } else { + titleBackup = document.title; + + 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); } - }, 1000); - } + } else { + document.title = langNotificationsPluralize(notificationsCount); + $('link[rel="icon"]:first').replaceWith(faviconNewEl); + } + }, 1000); } - }); - } + } + }); $rootScope.$on('apiUpdate', function (e, update) { // console.log('on apiUpdate', update);