PageSourceSearch

https://bnef.pl/wp-content/themes/bnef/js/navigation.js?ver=1.1.1

js bnef.pl collected 2026-10-04 15:24:28 UTC 1,069 bytes, 38 lines download raw bytes

1/**
2 * File navigation.js.
3 *
4 * Handles toggling the navigation menu for small screens and enables TAB key
5 * navigation support for dropdown menus.
6 */
7( function() {
8	const siteNavigation = document.getElementById( 'masthead' );
9
10	// Realna wysokość headera (z bannerem lub bez) → zmienna CSS --scroll-offset,
11	// używana przez scroll-margin-top celów kotwic.
12	const setScrollOffset = () => {
13		if ( ! siteNavigation ) {
14			return;
15		}
16		document.documentElement.style.setProperty(
17			'--scroll-offset',
18			siteNavigation.offsetHeight + 'px'
19		);
20	};
21
22	setScrollOffset();
23	window.addEventListener( 'load', setScrollOffset );
24	window.addEventListener( 'resize', setScrollOffset );
25	window.addEventListener( 'orientationchange', setScrollOffset );
26
27	window.addEventListener('scroll', () => {
28		if (window.scrollY > 10) {
29			siteNavigation.classList.remove('site-header');
30			siteNavigation.classList.add('site-header-narrow');
31		}
32		else {
33			siteNavigation.classList.remove('site-header-narrow');
34			siteNavigation.classList.add('site-header');
35		}
36	});
37
38}() );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.