Skip to content
Snippets Groups Projects
Commit a8ccbeb0 authored by shamalainen's avatar shamalainen
Browse files

Add scroll lock when mobile menu is open

parent 90702efb
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,13 @@ export class SiteHeader {
@Listen('mobileMenuToggle') mobileMenuToggle() {
this.isMenuOpen = !this.isMenuOpen;
this.menuMobileToggled.emit();
let bodyElement = document.getElementsByTagName('body')[0] as HTMLElement;
if (this.isMenuOpen) {
bodyElement.style.overflow = 'hidden';
} else {
bodyElement.style.overflow = 'initial';
}
}
// Listener for toggling mobile menu top panel on or off.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment