PageSourceSearch

https://ymtg.gov.ua/js/subdomain/modern/toggle-view.js

js ymtg.gov.ua collected 2026-10-02 22:10:00 UTC 1,020 bytes, 29 lines download raw bytes

1export function initViewToggle() {
2    const toggleContainer = document.querySelector(".toggle-view")
3    if (!toggleContainer) return
4
5    // grid is default
6    toggleContainer.classList.add("view-grid")
7
8    // if contrast is enabled, list is default
9    if (document.cookie.split('; ').find(row => row.startsWith('enable-contrast'))) {
10        toggleContainer.classList.remove("view-grid")
11        toggleContainer.classList.add("view-list")
12    }
13
14    const toggleListView = document.querySelector(".toggle-view-list")
15    if (!toggleListView) return
16    const toggleGridView = document.querySelector(".toggle-view-grid")
17    if (!toggleGridView) return
18
19    toggleGridView.addEventListener('click', () => {
20        toggleContainer.classList.add("view-grid")
21        toggleContainer.classList.remove("view-list")
22    })
23
24    toggleListView.addEventListener('click', () => {
25        toggleContainer.classList.add("view-list")
26        toggleContainer.classList.remove("view-grid")
27    })
28
29}

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.