* Initialize scroll behavior
()
| 48 | * Initialize scroll behavior |
| 49 | */ |
| 50 | function initScrollBehavior() { |
| 51 | // Add scroll event listener |
| 52 | window.addEventListener('scroll', handleScroll, { passive: true }); |
| 53 | |
| 54 | // Handle initial scroll position |
| 55 | handleScroll(); |
| 56 | |
| 57 | // Handle page navigation (for SPA-like behavior in Material) |
| 58 | document.addEventListener('DOMContentLoaded', handleScroll); |
| 59 | |
| 60 | // Handle instant navigation if enabled |
| 61 | if (typeof app !== 'undefined' && app.location$) { |
| 62 | app.location$.subscribe(handleScroll); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Cleanup function |
no test coverage detected