PageSourceSearch

https://www.waportal.ru/bitrix/templates/aspro_max/js/tabs_history.js

js waportal.ru collected 2026-10-09 21:38:50 UTC 2,216 bytes, 68 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
15		// show tab
16		idTabContent = _this.attr("href");
17		
18		if (idTabContent) {
19			let detailTextBlock = $(idTabContent).find('.ordered-block__text');
20			let nodeDetailSpoilerButton = $(idTabContent).find('.ordered-block__spoiler-btn');
21			if (detailTextBlock.length && nodeDetailSpoilerButton.length) {
22				showCollapsedBlock(detailTextBlock, nodeDetailSpoilerButton);
23			}
24		}
25
26
27		//top nav
28		if (_this.closest(".product-item-detail-tabs-list").length) {
29			if ($(".ordered-block .tabs").length) {
30				var content_offset = $(".ordered-block .tabs").offset(),
31					tab_height = $(".product-item-detail-tabs-container-fixed").actual("outerHeight"),
32					hfixed_height = $("#headerfixed").actual("outerHeight");
33				// $('html, body').animate({scrollTop: content_offset.top-hfixed_height-tab_height}, 400);
34				$("html, body").animate({ scrollTop: content_offset.top - 88 }, 400);
35
36				if (typeof initReviewsGallery !== 'undefined') {
37					initReviewsGallery(_this);
38				}
39			}
40		}
41
42		if (_this.attr("href") === "#stores" && $(".stores_tab").length) {
43			if (typeof map !== "undefined") {
44				map.container.fitToViewport();
45				if (typeof clusterer !== "undefined" && !$(".stores_tab").find(".detail_items").is(":visible")) {
46					map.setBounds(clusterer.getBounds(), {
47						zoomMargin: 40,
48						// checkZoomRange: true
49					});
50				}
51			}
52		}
53		if (_this.attr("href") === "#reviews" && $(".tab-pane.reviews").length && typeof initReviewsGallery !== 'undefined') {
54			initReviewsGallery(_this);
55		}
56		$(".nav.nav-tabs li").each(function () {
57			var _this = $(this);
58			if (!_this.find(" > a.linked").length) {
59				_this.removeClass("active");
60				if (_this.index() == parent.index()) {
61					_this.addClass("active");
62				}
63			}
64		});
65		InitLazyLoad();
66	});
67}
68

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.