2020-08-04 17:42:31 +02:00
|
|
|
let __notificationCount = '';
|
|
|
|
|
2020-07-29 22:48:49 +02:00
|
|
|
runAfterLoad(() => {
|
2020-08-04 17:42:31 +02:00
|
|
|
__notificationCount = getNotificationCount();
|
2020-07-29 22:48:49 +02:00
|
|
|
displayNotificationsInTitle();
|
|
|
|
}, ".*");
|
|
|
|
|
2020-08-04 17:42:31 +02:00
|
|
|
runAfterPathnameChange(() => {
|
|
|
|
displayNotificationsInTitle();
|
|
|
|
}, ".*");
|
|
|
|
|
|
|
|
function getNotificationCount() {
|
2020-07-29 23:09:13 +02:00
|
|
|
let menu = document.getElementById('materialize-menu-dropdown');
|
|
|
|
let menuDropdowns = Array.from(menu.querySelectorAll('ul.dropdown')).slice(-1)[0];
|
|
|
|
let notificationText = menuDropdowns.innerText.split(" ")[3];
|
2020-08-04 17:42:31 +02:00
|
|
|
return notificationText.split(" ")[1] + ' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
function displayNotificationsInTitle(){
|
|
|
|
document.title = __notificationCount + document.title;
|
|
|
|
}
|