Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Dec 27, 2018
2 parents 2d17919 + d212efb commit 2a592c8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
9 changes: 7 additions & 2 deletions http/js/iznik/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -468,7 +469,7 @@ define([
});
}

Iznik.setTitleCounts = function(chat, newsfeed) {
Iznik.setTitleCounts = function(chat, newsfeed, work) {
if (chat !== null) {
chatTitleCount = chat;
}
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions http/js/iznik/models/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ define([
})

document.title = (total == 0) ? 'ModTools' : ('(' + total + ') ModTools');
Iznik.setTitleCounts(null, null, total);

if (total) {
$('.js-workcount').html(total).show();
Expand Down
2 changes: 1 addition & 1 deletion http/js/iznik/views/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ define([
}
}

Iznik.setTitleCounts(titleunseen, null);
Iznik.setTitleCounts(titleunseen, null, null);
});

self.showMin();
Expand Down
4 changes: 2 additions & 2 deletions http/js/iznik/views/pages/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 12 additions & 16 deletions http/js/iznik/views/pages/user/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 2a592c8

Please sign in to comment.