PageSourceSearch

https://atlanttumen.ru/bitrix/templates/aspro-allcorp3medc/js/blocks/controls.js

js atlanttumen.ru collected 2026-09-28 18:12:16 UTC 7,330 bytes, 225 lines download raw bytes

1$(document).ready(function () {
2  // dropdown-select
3  $(document).on("click", ".dropdown-select .dropdown-select__title", function () {
4    var _this = $(this),
5      menu = _this.parent().find("> .dropdown-select__list");
6
7    if (!_this.hasClass("clicked")) {
8      _this.addClass("clicked");
9
10      _this.toggleClass("opened");
11      menu.stop().slideToggle(100, function () {
12        _this.removeClass("clicked");
13      });
14    }
15  });
16
17  // dropdown-select change item
18  $(document).on("click", ".dropdown-select__list .mixitup-item", function () {
19    var $select = $(this).closest('.dropdown-select');
20    $select.find('.dropdown-select__title span').text($(this).text());
21    $select.find('.dropdown-select__title.opened').click();
22  });
23
24  // close select
25  $("html, body").on("mousedown", function (e) {
26    if (typeof e.target.className == "string" && e.target.className.indexOf("adm") < 0) {
27      e.stopPropagation();
28
29      $(".dropdown-select .dropdown-select__title.opened").each(function(){
30        var $select = $(this).closest('.dropdown-select');
31        if(!$(e.target).closest($select).length) { 
32          $(this).click();
33        }
34      });
35    }
36  });
37
38  // hint
39  $(document).on("click", ".hint__icon", function (e) {
40    e.stopImmediatePropagation();
41    var tooltipWrapp = $(this).closest(".hint");
42    if (tooltipWrapp.hasClass("active")) {
43      tooltipWrapp.removeClass("active").find(".tooltip").slideUp(200);
44    } else {
45      tooltipWrapp.addClass("active");
46      tooltipWrapp.find(".tooltip").slideDown(200);
47      tooltipWrapp.find(".tooltip_close").click(function (e) {
48        e.stopPropagation();
49        e.stopImmediatePropagation();
50        tooltipWrapp.removeClass("active").find(".tooltip").slideUp(100);
51      });
52    }
53    e.stopPropagation();
54  });
55
56  // mixitUp
57  const containerEl = document.querySelector(".mixitup-container");
58  if (containerEl) {
59    var config = {
60      selectors: {
61        target: '[data-ref="mixitup-target"]',
62      },
63      /*animation: {
64        effects: "fade scale stagger(150ms)", // Set a 'stagger' effect for the loading animation
65      },*/
66      animation: {
67        effects: "", // Set a 'stagger' effect for the loading animation
68      },
69      load: {
70        filter: "none", // Ensure all targets start from hidden (i.e. display: none;)
71      },
72      animation: {
73        duration: 350,
74      },
75      controls: {
76        scope: "local",
77      },
78      callbacks: {
79        onMixStart: function (state) {
80          // console.log(state);
81        },
82        onMixClick: function (state, event) {
83          let $item = event.target.children.length ? event.target : event.target.parentElement;
84          $($item).siblings().removeClass("color-theme head-block__item--active active");
85          $($item).addClass("color-theme head-block__item--active active");
86        },
87        onMixEnd: function () {
88          // InitLazyLoad();
89        },
90      },
91    };
92    var mixer = mixitup(containerEl, config);
93
94    containerEl.classList.add("mixitup-ready");
95
96    mixer.show().then(function () {
97      // Remove the stagger effect for any subsequent operations
98      mixer.configure({
99        animation: {
100          effects: "fade scale",
101        },
102      });
103    });
104  }
105
106  /*show password*/
107  $(".form-group:not(.eye-password-ignore) [type=password]").each(function (item) {
108    let passBlock = $(this).closest(".form-group");
109    let labelBlock = passBlock.find(".label_block");
110    if (labelBlock.length) {
111      labelBlock.addClass("eye-password");
112    } else {
113      passBlock.addClass("eye-password");
114    }
115  });
116  $(document).on("click", ".eye-password:not(.eye-password-ignore)", function (event) {
117    let input = this.querySelector("input");
118    let eyeWidth = 56;
119    if (this.clientWidth - eyeWidth < event.offsetX) {
120      if (input.type == "password") {
121        input.type = "text";
122        this.classList.add("password-show");
123      } else if (input.type == "text") {
124        input.type = "password";
125        this.classList.remove("password-show");
126      }
127      event.stopPropagation();
128    }
129  });
130  /**/
131});
132
133// gallery switch
134$(document).on("click", ".gallery-view_switch__icons:not(.active)", function () {
135  var $this = $(this);
136  var animationTime = 200;
137  var bSmall = $this.hasClass("gallery-view_switch__icons--small");
138  var $switchGallery = $this.closest(".gallery-view_switch");
139  var $bigGallery = ($this.closest(".big_gallery").length
140    ? $this.closest(".big_gallery")
141    : $this.closest(".gallery")
142  ).find(".gallery-big");
143  var $bigGalleryCounter = $switchGallery.find(".gallery-view_switch__count-wrapper--big");
144  var $smallGallery = ($this.closest(".big_gallery").length
145    ? $this.closest(".big_gallery")
146    : $this.closest(".gallery")
147  ).find(".gallery-small");
148  var $smallGalleryCounter = $switchGallery.find(".gallery-view_switch__count-wrapper--small");
149  var $toHideGallery = bSmall ? $bigGallery : $smallGallery;
150  var $toHideGalleryCounter = bSmall ? $bigGalleryCounter : $smallGalleryCounter;
151  var $toShowGallery = bSmall ? $smallGallery : $bigGallery;
152  var $toShowGalleryCounter = bSmall ? $smallGalleryCounter : $bigGalleryCounter;
153
154  $this.addClass("active");
155  $this.siblings(".active").removeClass("active");
156
157  $toHideGalleryCounter.fadeOut(animationTime, function () {
158    $toShowGalleryCounter.fadeIn(animationTime);
159  });
160
161  $toHideGallery.fadeOut(animationTime, function () {
162    $toShowGallery.fadeIn(animationTime);
163  });
164});
165/*buy opt table items*/
166function optBuyBasketAction(basketItems, itemsToNotice) {
167  const basketParams = {
168    type: "multiple",
169    ajaxPost: "Y",
170    // iblock_id: _this.data("iblock_id"),
171    action: "buy",
172    items: [],
173  };
174  if (basketItems) {
175    basketParams["items"] = basketItems;
176  }
177
178  var bBasketTop =
179    typeof arAsproOptions["THEME"]["ORDER_BASKET_VIEW"] !== "undefined" &&
180    $.trim(arAsproOptions["THEME"]["ORDER_BASKET_VIEW"]) === "HEADER" &&
181    $(".basket.top").length;
182  var bBasketFly =
183    typeof arAsproOptions["THEME"]["ORDER_BASKET_VIEW"] !== "undefined" && !bBasketTop && $(".basket.fly").length;
184
185  if (basketParams["items"].length) {
186    $.ajax({
187      url: arAsproOptions["SITE_DIR"] + "include/footer/basket.php",
188      type: "POST",
189      data: basketParams,
190    }).done(function (html) {
191      if (bBasketTop) {
192        $(".ajax_basket").replaceWith(html);
193      } else if (bBasketFly) {
194        $(".ajax_basket").html($($.trim(html)).html());
195      }
196
197      // show cart or notice
198      if (typeof JNoticeSurface === "undefined") {
199        if (bBasketTop) {
200          $(".header-cart").addClass("opened");
201
202          if (typeof headerCartHideTimer !== "undefined") {
203            clearTimeout(headerCartHideTimer);
204          }
205
206          headerCartHideTimer = setTimeout(function () {
207            $(".header-cart").removeClass("opened");
208          }, 2000);
209        } else if (bBasketFly) {
210          setTimeout(function () {
211            if (!$(".ajax_basket").hasClass("opened")) {
212              $(".ajax_basket").addClass("opened");
213            }
214          }, 50);
215        }
216      } else {
217        JNoticeSurface.get().onAdd2cart(itemsToNotice);
218      }
219
220      var eventdata = { action: "loadBasket" };
221      BX.onCustomEvent("onCompleteAction", [eventdata, $(html)]);
222      setBasketItemsClasses();
223    });
224  }
225}

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.