#19 changing the title via document.title
This commit is contained in:
parent
1715e8fa7f
commit
05a4a730ec
|
@ -6,5 +6,5 @@ function displayNotificationsInTitle(){
|
||||||
let menu = document.getElementById('materialize-menu-dropdown');
|
let menu = document.getElementById('materialize-menu-dropdown');
|
||||||
let menuDropdowns = Array.from(menu.querySelectorAll('ul.dropdown')).slice(-1)[0];
|
let menuDropdowns = Array.from(menu.querySelectorAll('ul.dropdown')).slice(-1)[0];
|
||||||
let notificationText = menuDropdowns.innerText.split(" ")[3];
|
let notificationText = menuDropdowns.innerText.split(" ")[3];
|
||||||
document.querySelector('head > title').insertAdjacentText('afterbegin', notificationText.split(" ")[1] + ' ');
|
document.title = notificationText.split(" ")[1] + ' ' + document.title;
|
||||||
}
|
}
|
Loading…
Reference in a new issue