PageSourceSearch

https://petra.by/bitrix/templates/aspro_max/js/tabs_history.js

js petra.by collected 2026-10-04 08:34:33 UTC 1,996 bytes, 54 lines download raw bytes

1function tabsHistory () {
2    $("a.linked").on("shown.bs.tab", function (e) {
3    var hashLink = $(this).attr("href").replace("#", "");
4    $(this).closest(".ordered-block").find(".tab-pane").removeClass("cur");
5    $("#" + hashLink).addClass("cur");
6  });
7
8  $('a[data-toggle="tab"]:not(.linked)').on("shown.bs.tab", function (e) {
9    var _this = $(e.target),
10      parent = _this.parent();
11    if (_this.attr("href")) {
12      history.pushState({}, "", _this.attr("href"));
13    }
14    //top nav
15    if (_this.closest(".product-item-detail-tabs-list").length) {
16      if ($(".ordered-block .tabs").length) {
17        var content_offset = $(".ordered-block .tabs").offset(),
18          tab_height = $(".product-item-detail-tabs-container-fixed").actual("outerHeight"),
19          hfixed_height = $("#headerfixed").actual("outerHeight");
20        // $('html, body').animate({scrollTop: content_offset.top-hfixed_height-tab_height}, 400);
21        $("html, body").animate({ scrollTop: content_offset.top - 88 }, 400);
22
23        if (typeof initReviewsGallery !== 'undefined') {
24          initReviewsGallery(_this);
25        }
26      }
27    }
28
29    if (_this.attr("href") === "#stores" && $(".stores_tab").length) {
30      if (typeof map !== "undefined") {
31        map.container.fitToViewport();
32        if (typeof clusterer !== "undefined" && !$(".stores_tab").find(".detail_items").is(":visible")) {
33          map.setBounds(clusterer.getBounds(), {
34            zoomMargin: 40,
35            // checkZoomRange: true
36          });
37        }
38      }
39    }
40    if (_this.attr("href") === "#reviews" && $(".tab-pane.reviews").length && typeof initReviewsGallery !== 'undefined') {
41      initReviewsGallery(_this);
42    }
43    $(".nav.nav-tabs li").each(function () {
44      var _this = $(this);
45      if (!_this.find(" > a.linked").length) {
46        _this.removeClass("active");
47        if (_this.index() == parent.index()) {
48          _this.addClass("active");
49        } 
50      }
51    });
52    InitLazyLoad();
53  });
54}    

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.