Use the nifty new DocumentTitleAPI to update notification count
and page titles when browsing assets. This removes the need for updateTitle()
This commit is contained in:
@@ -31,16 +31,6 @@ var DocumentTitleAPI = {
|
||||
},
|
||||
};
|
||||
|
||||
var page_title = document.title;
|
||||
|
||||
function updateTitle(unread_on_load, page_title){
|
||||
|
||||
if (unread_on_load > 0){
|
||||
document.title = '(' + unread_on_load + ') ' + page_title;
|
||||
} else {
|
||||
document.title = page_title;
|
||||
}
|
||||
}
|
||||
|
||||
/* Status Bar */
|
||||
function statusBarClear(delay_class, delay_html){
|
||||
|
@@ -98,9 +98,8 @@ function getNotifications(){
|
||||
$notifications_count.html('<span>' + unread_new + '</span>');
|
||||
$notifications_toggle.addClass('has-notifications');
|
||||
|
||||
// Let Pillar know the notifications total has been updated.
|
||||
// Used for example to update of the page title via updateTitle();
|
||||
$('body').trigger('pillar:notifications-total-updated', unread_new);
|
||||
// Update notifications count on the document title
|
||||
DocumentTitleAPI.set_notification_count(unread_new);
|
||||
|
||||
} else {
|
||||
clearNotificationIcon();
|
||||
@@ -328,11 +327,9 @@ $(function() {
|
||||
|
||||
clearNotificationIcon();
|
||||
|
||||
unread_on_load = 0;
|
||||
// Update notifications count on the document title
|
||||
DocumentTitleAPI.set_notification_count(0);
|
||||
|
||||
// Let Pillar know the notifications total has been updated.
|
||||
// Used for example to update of the page title via updateTitle();
|
||||
$('body').trigger('pillar:notifications-total-updated', unread_on_load);
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user