PageSourceSearch

https://www.sb.by/local/templates/media/components/header.js?17761565251021

js sb.by collected 2026-09-24 08:46:24 UTC 1,021 bytes, 33 lines download raw bytes

1function run() {
2    const deepLinks = document.querySelectorAll('.js-deep-menu-link')
3
4    deepLinks.forEach((link) => {
5        link.addEventListener('click', (ev) => {
6            ev.preventDefault()
7
8            const id = link.getAttribute('data-id')
9            const headerMenu = window.slam?.headerMenu
10            if (!headerMenu) return
11
12            const menu = headerMenu.menu
13            if (!menu) return
14
15            const navItems = menu.querySelectorAll('.slam-menu__nav-item')
16            navItems.forEach((item) => item.classList.remove('active'))
17
18            const targetItem = menu.querySelector(`.slam-menu__nav-item[data-deep-link-id="${id}"]`)
19            if (targetItem) {
20                targetItem.classList.add('active')
21            }
22
23            if (!headerMenu.active) {
24                headerMenu.open()
25            }
26        })
27    })
28}
29
30if (typeof window !== 'undefined') {
31    window.addEventListener('ReactContentLoaded', run)
32    document.addEventListener('DOMContentLoaded', run)
33}

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.