()
| 31 | readonly isBrowser = computed(() => isPlatformBrowser(this.platform)); |
| 32 | |
| 33 | constructor() { |
| 34 | // Navigation listener with automatic cleanup |
| 35 | this.router.events |
| 36 | .pipe( |
| 37 | filter(event => event instanceof NavigationEnd), |
| 38 | takeUntilDestroyed() |
| 39 | ) |
| 40 | .subscribe(() => this.menuOpen.set(false)); |
| 41 | |
| 42 | // Body overflow management only in browser |
| 43 | if (this.isBrowser()) { |
| 44 | effect(() => { |
| 45 | // Prevent scrolling when mobile menu is open |
| 46 | if (this.menuOpen()) { |
| 47 | document.body.style.overflow = 'hidden'; |
| 48 | document.body.classList.add('menu-open'); |
| 49 | } else { |
| 50 | document.body.style.overflow = ''; |
| 51 | document.body.classList.remove('menu-open'); |
| 52 | } |
| 53 | }); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // Enhanced menu toggle with proper accessibility |
| 58 | toggleMenu(): void { |
nothing calls this directly
no outgoing calls
no test coverage detected