PageSourceSearch

https://tangierslounge.ru/wp-content/themes/tangiers-lounge/js/header.js?ver=1.2.1

js tangierslounge.ru collected 2026-10-07 13:05:13 UTC 5,313 bytes, 143 lines download raw bytes

1//document.addEventListener("DOMContentLoaded", () => {
2
3jQuery(function ($) {
4  let header = window.document.querySelector("header");
5  let btnMenuHam = window.document.querySelector(".menu__btn");
6  let btnMenu = window.document.querySelector(".header-container-right-btn");
7
8  let btnMenuMobile = window.document.querySelector(".header-container-right-btn-mobile");
9
10  let modalMenu = window.document.querySelector(".modal-header-book");
11  let closeMenu = window.document.querySelector(".modal-header-book-close");
12
13  //const chooseCity = window.document.querySelector(".dropbtn");
14  const chooseCityMob = window.document.querySelector(".burger__dropbtn");//5
15  const chooseCityMobBtn = window.document.querySelector(".burger__dropbtn-btn");//5
16  const searchCityMob = window.document.querySelector(".close");
17  //const tooltipClose = window.document.querySelector(".tooltip__icon");
18  const mapingList = window.document.querySelector(".maping-list");
19  const searchCity = window.document.querySelector(".search__city");
20  const BurgerMenu = window.document.querySelector(".burger__menu");
21  const BurgerCity = [
22    ...window.document.querySelectorAll(".burger__menu-city"),
23  ];
24
25  const FooterBron = window.document.querySelector(".burger__footer-btn");
26
27  searchCityMob.parentNode.style.display = "none";
28
29  // Sticky-шапка: добавляем фон, когда страницу прокрутили вниз
30  const toggleHeaderScrolled = () => {
31    header.classList.toggle("header--scrolled", window.scrollY > 50);
32  };
33  toggleHeaderScrolled();
34  window.addEventListener("scroll", toggleHeaderScrolled, { passive: true });
35
36  btnMenuHam.addEventListener("click", function () {
37
38    header.classList.toggle("header-active-bg");
39    //  tooltipClose.parentNode.classList.add("tooltip__hidden");
40  });
41
42  if (btnMenu) {
43  btnMenu.addEventListener("click", function () {
44    modalMenu.style.opacity = "1";
45    modalMenu.style.zIndex = "999999999999999";
46  });
47} else {
48  console.log('Element with not found!');
49}
50  if (btnMenuMobile) {
51    btnMenuMobile.addEventListener("click", function () {
52      modalMenu.style.opacity = "1";
53      modalMenu.style.zIndex = "999999999999999";
54    });
55  } else {
56    console.log('Element with not found!');
57  }
58  if (closeMenu) {
59    closeMenu.addEventListener("click", function () {
60      modalMenu.style.opacity = "0";
61      modalMenu.style.zIndex = "-1";
62    });
63  } else {
64    console.log('Element with selector #closeMenu not found!');
65  }
66
67  document.querySelector("#menu__toggle").addEventListener("change", () => {
68    document.body.style.overflow = document.querySelector("#menu__toggle")
69      .checked
70      ? "hidden"
71      : "auto";
72  });
73
74  chooseCityMobBtn.addEventListener("click", () => {
75    chooseCityMob.parentNode.style.display = "none";
76    chooseCityMob.parentNode.parentNode.style.background = "none";
77    searchCityMob.parentNode.style.display = "flex";
78    if (FooterBron) {
79      FooterBron.style.display = "none";
80    }
81    BurgerCity[0].classList.remove("burger__menu-city-active");
82    BurgerMenu.style.display = "none";
83  });
84  searchCityMob.addEventListener("click", () => {
85    chooseCityMob.parentNode.style.display = "flex";
86    chooseCityMob.parentNode.parentNode.style.background = "#dfdfdf";
87    searchCityMob.parentNode.style.display = "none";
88    if (FooterBron) {
89      FooterBron.style.display = "none";
90    }
91    BurgerCity[0].classList.add("burger__menu-city-active");
92    BurgerMenu.style.display = "block";
93  });
94
95
96
97  $('[id^="bmc_"]').click(function () {
98    $('.parent_menu_city').not('.parent_menu-city-active').toggle();
99
100    let idNumber = this.id.replace('bmc_', ''); // Извлекаем число из ID
101    let childId = 'bmc_' + idNumber + '-child';  // Создаем ID дочернего элемента
102
103    //$('#' + childId).toggleClass('burger__menu-city-active');
104    $('[data-bmc="' + childId + '"]').toggleClass('burger__menu-city-active');
105  });
106
107
108  searchCity.addEventListener("input", (e) => {
109    const cityMobileAll = document.getElementById('city-mobile-all');
110    if (!cityMobileAll) {
111      console.error("Element with ID 'city-mobile-all' not found.");
112      return;
113    }
114
115
116    const arr = [...cityMobileAll.querySelectorAll('.city-lin')]
117      .filter((el) =>
118        //  el.classList.contains('city-lin') && // Добавлено условие
119        el.textContent.toLowerCase().includes(e.target.value.toLowerCase())
120      )
121      .map((elem) => `<a class="city-lin parent_menu_city" href="${elem.cloneNode(true)}" >${elem.textContent}</a>`)
122      .join("");
123
124    // <a class="city-lin parent_menu_city" href="/">Бали</a>  вместо этого `<li>${elem.textContent}</li>`
125
126    mapingList.innerHTML = arr;
127
128    if (e.target.value !== "") {
129      cityMobileAll.style.display = 'none';
130      mapingList.classList.remove("burger__menu-city-active"); // Убрал лишние классы
131      mapingList.style.display = "block"; //Отображаем список
132
133    } else {
134      mapingList.style.display = "none"; //Скрываем список если поле пустое
135      cityMobileAll.style.display = '';
136    }
137  });
138
139  /* tooltipClose.addEventListener("click", () => {
140     tooltipClose.parentNode.classList.toggle("tooltip__hidden");
141   });*/
142
143});

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.