PageSourceSearch

https://minoko.com.ua/catalog/view/javascript/main.js

js minoko.com.ua collected 2026-10-07 19:41:54 UTC 3,580 bytes, 114 lines download raw bytes

1window.addEventListener('DOMContentLoaded', (event) => {
2  /* Custom-select */
3  // Применяем кастомный стиль ко всем элементам select, кроме тех, которые имеют класс "disable-custom-style"
4  var mySelect = $("select").customSelect();
5
6  // Удаляем кастомный стиль у элементов select с классом "disable-custom-style"
7  $("select.disable-custom-style").customSelect("destroy");
8
9  /* Sticky header */
10  window.addEventListener('scroll', function (e) {
11    window.scrollY > 80
12      ? document.body.classList.add('sticky_header')
13      : document.body.classList.remove('sticky_header');
14  });
15});
16/* ------------ */
17
18// Перевіряємо, чи існує елемент з класом 'mobile_panel'
19const mobilePanel = document.querySelector('.mobile_panel');
20const footer = document.querySelector('footer');
21
22// Якщо елемент з класом 'mobile_panel' є
23if (mobilePanel && footer) {
24    // Отримуємо висоту блоку 'mobile_panel'
25    const mobilePanelHeight = mobilePanel.offsetHeight;
26
27    // Додаємо стиль 'padding-bottom' до 'footer' з висотою 'mobile_panel'
28    footer.style.paddingBottom = mobilePanelHeight + 'px';
29}
30/* ------------ */
31
32/* Title move */
33$(document).ready(function () {
34  // if ($(window).width() > 1023.98) {
35    $(window).scroll(function () {
36      var scrollPos = $(this).scrollTop() / 4;
37      $('.title_scroll').css({
38        transform: 'translateX(' + -scrollPos + 'px)',
39      });
40    });
41  // }
42});
43/* ------------ */
44
45jQuery(function($){
46  $(".btn-currency").click(function(e) {
47    e.preventDefault();
48    $(".btn-currency-menu").toggleClass("in");
49  });
50
51  $(".btn-language").click(function(e) {
52    e.preventDefault();
53    $(".btn-language-menu").toggleClass("in");
54  });
55
56  $(".account").click(function() {
57    $(".account-menu").toggleClass("in");
58  });
59
60  $(document).mouseup(function(e) {
61    checkAndRemoveClass(".btn-currency-menu, .btn-currency", 'in', e);
62    checkAndRemoveClass(".btn-language-menu, .btn-language", 'in', e);
63    checkAndRemoveClass(".main-menu-content, .main-menu", 'in', e);
64    checkAndRemoveClass(".account-menu, .account", 'in', e);
65    checkAndRemoveClass("#cart, .container-cart", 'in', e);
66  });
67
68  function checkAndRemoveClass(selector, className, event) {
69      var div = $(selector);
70      if (!div.is(event.target) && div.has(event.target).length === 0) {
71          div.removeClass(className);
72      }
73  }
74});
75
76/* Menu Catalog */
77$(function () {
78
79  function openMenu() {
80    $('#overlay, .sc-megamenu, html').addClass('active lock');
81  }
82
83  function closeMenu() {
84    $('#overlay, .sc-megamenu, html').removeClass('active lock');
85    $('.sc-megamenu-child').removeClass('active');
86  }
87
88  function toggleMenu(e) {
89    if (e) e.preventDefault();
90    $('#overlay, .sc-megamenu, html').toggleClass('active lock');
91
92    if (!$('.sc-megamenu').hasClass('active')) {
93      $('.sc-megamenu-child').removeClass('active');
94    }
95  }
96  $(document).on('click', '#show_categories_btn', toggleMenu);
97
98  $(document).on('click', '.sidebar-header svg', closeMenu);
99
100  $(document).on('click', '#overlay', closeMenu);
101
102  $(document).on('click', '.sc-megamenu-list-item > svg', function (e) {
103    e.preventDefault();
104    $(this).siblings('.sc-megamenu-child').addClass('active');
105  });
106
107  $(document).on('click', '.prev-catalog', function (e) {
108    e.preventDefault();
109    $(this).closest('.sc-megamenu-child').removeClass('active');
110  });
111
112});
113
114/* ------------ */

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.