diff --git a/http/js/iznik/base.js b/http/js/iznik/base.js index 223866810..c1a42fc7a 100644 --- a/http/js/iznik/base.js +++ b/http/js/iznik/base.js @@ -441,6 +441,7 @@ define([ var chatTitleCount = 0; var newsfeedTitleCount = 0; + var workTitleCount = 0; Iznik.setHeaderCounts = function (chatcount, notifcount) { // This if test improves browser performance by avoiding unnecessary show/hides. @@ -468,7 +469,7 @@ define([ }); } - Iznik.setTitleCounts = function(chat, newsfeed) { + Iznik.setTitleCounts = function(chat, newsfeed, work) { if (chat !== null) { chatTitleCount = chat; } @@ -477,7 +478,11 @@ define([ newsfeedTitleCount = newsfeed; } - var unseen = chatTitleCount + newsfeedTitleCount; + if (work !== null) { + workTitleCount = work; + } + + var unseen = chatTitleCount + newsfeedTitleCount + workTitleCount; // We'll adjust the count in the window title. var title = document.title; diff --git a/http/js/iznik/models/session.js b/http/js/iznik/models/session.js index e2d98879b..c13dfc1ea 100644 --- a/http/js/iznik/models/session.js +++ b/http/js/iznik/models/session.js @@ -463,6 +463,7 @@ define([ }) document.title = (total == 0) ? 'ModTools' : ('(' + total + ') ModTools'); + Iznik.setTitleCounts(null, null, total); if (total) { $('.js-workcount').html(total).show(); diff --git a/http/js/iznik/views/chat/chat.js b/http/js/iznik/views/chat/chat.js index 5e3012f3a..44dc6975f 100644 --- a/http/js/iznik/views/chat/chat.js +++ b/http/js/iznik/views/chat/chat.js @@ -223,7 +223,7 @@ define([ } } - Iznik.setTitleCounts(titleunseen, null); + Iznik.setTitleCounts(titleunseen, null, null); }); self.showMin(); diff --git a/http/js/iznik/views/pages/pages.js b/http/js/iznik/views/pages/pages.js index 1faab6882..42049484f 100644 --- a/http/js/iznik/views/pages/pages.js +++ b/http/js/iznik/views/pages/pages.js @@ -137,10 +137,10 @@ define([ $('.js-notifholder .js-notifcount').css('visibility', 'hidden'); } - Iznik.setTitleCounts(null, ret.count); + Iznik.setTitleCounts(null, ret.count, null); } - Iznik.setTitleCounts(null, ret.count); + Iznik.setTitleCounts(null, ret.count, null); } }, complete: function() { // We have the unseen newsfeed count in the session. That is loosely up to date, which is diff --git a/http/js/iznik/views/pages/user/settings.js b/http/js/iznik/views/pages/user/settings.js index 4367ee13b..66e3ddf0a 100644 --- a/http/js/iznik/views/pages/user/settings.js +++ b/http/js/iznik/views/pages/user/settings.js @@ -533,25 +533,21 @@ define([ self.showHideMine(); - if (me.hasOwnProperty('notifications')) { - self.$(".js-pushswitch").bootstrapSwitch({ - onText: 'Browser Popups On', - offText: 'Browser Popups Off', - state: notifs.hasOwnProperty('push') ? notifs.push: true - }); + self.$(".js-pushswitch").bootstrapSwitch({ + onText: 'Browser Popups On', + offText: 'Browser Popups Off', + state: notifs.hasOwnProperty('push') ? notifs.push: true + }); - self.$('.js-pushon').show(); - } + self.$('.js-pushon').show(); - if (me.hasOwnProperty('notifications')) { - self.$(".js-appswitch").bootstrapSwitch({ - onText: 'App Notifications On', - offText: 'App Notifications Off', - state: notifs.hasOwnProperty('app') ? notifs.app: true - }); + self.$(".js-appswitch").bootstrapSwitch({ + onText: 'App Notifications On', + offText: 'App Notifications Off', + state: notifs.hasOwnProperty('app') ? notifs.app: true + }); - self.$('.js-appon').show(); - } + self.$('.js-appon').show(); var facebook = Iznik.Session.hasFacebook();