set page title if not in main menue
This commit is contained in:
parent
3b2d2631f0
commit
83ab214710
2 changed files with 6 additions and 3 deletions
|
@ -14,10 +14,10 @@ class Header extends HTMLElement {
|
|||
<jl-svg data-name="banner"></jl-svg>
|
||||
</div >
|
||||
</div >
|
||||
<jl-main_menu id = "mainMenu"></jl-main_menu>
|
||||
<jl-main_menu id = "mainMenu" data-title = "${pageTitle}"></jl-main_menu>
|
||||
</header>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("jl-header", Header);
|
||||
customElements.define("jl-header", Header);
|
||||
|
|
|
@ -73,7 +73,10 @@ class MainMenu extends HTMLElement {
|
|||
});
|
||||
|
||||
this.appendChild(menuContainer);
|
||||
if(document.title == "") {
|
||||
document.title = this.getAttribute("data-title") + " - Jonas Leder";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("jl-main_menu", MainMenu);
|
||||
customElements.define("jl-main_menu", MainMenu);
|
||||
|
|
Loading…
Reference in a new issue