PageSourceSearch

https://www.hs-kempten.de/_assets/a92153751098915699a1afa17e77f864/JavaScript/main-menu-burgerbutton.js

js hs-kempten.de collected 2026-09-25 20:50:20 UTC 996 bytes, 31 lines download raw bytes

1export default (hamburgerButton, menubox) => {
2    hamburgerButton.addEventListener('click', (e) => {
3        if (!hamburgerButton.classList.contains('is-active')) {
4            e.stopPropagation();
5            document.dispatchEvent(
6                new CustomEvent('triggerMenuBox'),
7            );
8        }
9
10        hamburgerButton.classList.toggle('is-active');
11
12        if (menubox) {
13            menubox.classList.toggle('isopen');
14        }
15    });
16
17    let initDocumentWidth = document.documentElement.clientWidth;
18
19    window.addEventListener('resize', () => {
20        if (initDocumentWidth !== document.documentElement.clientWidth) {
21            hamburgerButton.classList.remove('is-active');
22            menubox.classList.remove('isopen');
23            initDocumentWidth = document.documentElement.clientWidth;
24        }
25    });
26
27    window.addEventListener('click', () => {
28        hamburgerButton.classList.remove('is-active');
29        menubox.classList.remove('isopen');
30    });
31};

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.