PageSourceSearch

https://mi.by/local/components/manao/select.location/templates/.default/script.js?17381248071790

js mi.by collected 2026-10-04 02:39:35 UTC 1,790 bytes, 43 lines download raw bytes

1$(document).ready(function () {
2    const modal = document.querySelector("#region")
3    const wrapper = modal.querySelector(".modal__form-wrapper")
4    const searchInput = modal.querySelector(".search")
5    const searchItems = modal.querySelectorAll(".location")
6
7    let location = getCookie('location');
8    if (location) {
9        const currentLocation = modal.querySelector(`.location__radio[value="${location}"]`);
10        $(currentLocation).prop('checked', true);
11
12        document.addEventListener('modal-open', () => {
13            currentLocation.scrollIntoView({ block: 'start', behavior: 'auto' })
14        });
15    } else {
16        const defaultLocation = modal.querySelector(`.location__radio[checked]`).value;
17        document.cookie = 'location=' + defaultLocation + '; path=/;';
18    }
19
20    let buttonLocation = $('.header__top-location .hedaer__top-location-button');
21    buttonLocation && buttonLocation.text(location);
22    // let selectCityDetailProduct = $('.select-city .select-city__selected span');
23    // selectCityDetailProduct && selectCityDetailProduct.text(location);
24
25    if ($('.shop-list__filter')) {
26        let shopListFilter = $('.shop-list__filter');
27    }
28
29    $('#region').on('change', '.location__radio', function (e) {
30        document.cookie = 'location=' + e.target.value + '; path=/;';
31        buttonLocation && buttonLocation.text(e.target.value);
32        // selectCityDetailProduct && selectCityDetailProduct.text(e.target.value);
33
34        if(typeof shopListFilter !== "undefined") {
35            shopListFilter && shopListFilter.find('input[type="radio"][value="' + e.target.value + '"] + span.location__label')[0].click();
36        }
37    })
38
39    searchInput.addEventListener("input", function () {
40        searchTrigger(this, searchItems)
41    })
42
43});

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.