PageSourceSearch

https://sbuket-nn.ru/bitrix/templates/dresscodeV2/js/script.js

js sbuket-nn.ru collected 2026-10-09 21:49:26 UTC 9,838 bytes, 350 lines download raw bytes

1$(function() {
2	$.ajax({
3		url: '/ajax/oneclick.php',
4		method: 'POST',
5		dataType: 'json',
6		success: (r) => {
7			document.body.insertAdjacentHTML('beforeend', r.html);
8		}
9	});
10
11	$('.tags-block a').removeAttr("onclick");
12	$(".areasItems .dashed").click(function(e){
13		$(this).closest("li").find(".subMenu").toggleClass('opened');
14		return false;
15	});
16	$('.subMenu .subMenuItem').click( function(e){
17		var cHtml = $(this).html();
18		$(this).closest("li").find(".dashed").html(cHtml);
19		$(this).closest("li").find(".subMenu").toggleClass('opened');
20		// alert($(this).closest("li").find(".areasItems .dashed").html());
21	});
22	$(document).click( function(e){
23		if ( $(e.target).closest('.subMenu.opened').length ) {
24			return;
25		}
26		$('.subMenu').removeClass("opened");
27	});
28
29	var index = 0;
30	var index_body = 0;
31	// function menuControl(){
32	// 	if($('.menuContainerColor').hasClass('fixedh')) {
33	// 		$('#mobilesIcons').css({'position' : 'fixed', 'top' : '-7px'});
34	// 		$('#mobilesSearch').css({'position' : 'fixed', 'top' : '65px'});
35	// 		$('#mobilesTelephone').css({'position' : 'fixed', 'top' : '65px', 'z-index' : '1000'});
36	// 	} else {
37	// 		$('#mobilesIcons').css({'position' : 'absolute', 'top' : '125px'});
38	// 		$('#mobilesSearch').css({'position' : 'absolute', 'top' : '0'});
39	// 		$('#mobilesTelephone').css({'position' : 'static'});
40	// 	}
41	// }
42	// $('#ORDER_CONFIRM_BUTTON').on('click', function(){
43	// 	menuControl()
44	// })
45	$(window).on('scroll', function() {
46		if($('.menuContainerColor').hasClass('fixedh')) {
47			$('#mobilesIcons').css({'position' : 'fixed', 'top' : '-7px'});
48			$('#mobilesSearch').css({'position' : 'fixed', 'top' : '65px'});
49			$('#mobilesTelephone').css({'position' : 'fixed', 'top' : '65px', 'z-index' : '1000'});
50		} else {
51			$('#mobilesIcons').css({'position' : 'absolute', 'top' : '125px'});
52			$('#mobilesSearch').css({'position' : 'absolute', 'top' : '0'});
53			$('#mobilesTelephone').css({'position' : 'static'});
54		}
55	});
56
57	$('#openLiveSearch').on('click', function() {
58		//$('#mobilesSearch, #TB_overlay').fadeIn();
59		$('#mobilesSearch').fadeIn();
60
61		if($('.menuContainerColor').hasClass('fixedh')) {
62			$('#mobilesSearch').css({'position' : 'fixed', 'top' : '65px'});
63		} else {
64			$('#mobilesSearch').css({'position' : 'absolute', 'top' : '0'});
65		}
66	});
67
68	$('.close-live-search').on('click', function() {
69		//$('#mobilesSearch, #TB_overlay').fadeOut();
70		$('#mobilesSearch').fadeOut();
71		$('#qM').val('');
72		$('#search_result_m').html('');
73		$('#mobilesSearch').css({'padding-bottom' : '45px'});
74		$('#searchResult').removeClass('visible');
75		$('#searchOverlap').css({'display' : 'none'});
76
77		//$('#mobilesIcons').css({'position' : 'absolute', 'top' : '125px'});
78	});
79
80	$('.btn-live-search').on('click', function() {
81		if($('#qM').val() != '') {
82			location.href = '/search?q=' + $('#qM').val();
83		}
84	});
85
86	$('.mobiles-phone').on('click', function() {
87		$('#mobilesTelephone').fadeIn();
88
89		if(index_body != 0) {
90			$('#catalogSlideButton').click();
91		}
92
93		if($('.menuContainerColor').hasClass('fixedh')) {
94			$('body').css({'overflow' : 'hidden'});
95			$('#mobilesTelephone').css({'position' : 'fixed', 'top' : '65px', 'z-index' : '10000'});
96		} else {
97			$('#mobilesTelephone').css({'position' : 'static'});
98		}
99	});
100
101	$('.close-mobile-phone').on('click', function() {
102		$('body').css({'overflow' : 'auto'});
103		$('#mobilesTelephone').fadeOut();
104
105		//$('#mobilesIcons').css({'position' : 'absolute', 'top' : '125px'});
106	});
107
108	$('#catalogSlideButton').on('click', function() {
109		if(index == 0) {
110			var elem = $('#subUnderMenu').html();
111			$('#mainMenu').append(elem);
112			$('#mainMenu a').css({'color' : '#fff', 'font-weight' : 'bold', 'text-decoration' : 'none'});
113			index++;
114		}
115		var height_menu = document.documentElement.clientHeight - 196;
116		if($('.menuContainerColor').hasClass('fixedh')) {
117			//height_menu = document.documentElement.clientHeight - 65;
118			height_menu = document.documentElement.clientHeight;
119		}
120		// $('#mainMenu').mCustomScrollbar('destroy');
121		// $('#mainMenu').mCustomScrollbar({
122        //     scrollInertia: 500,
123        //     setHeight: height_menu,
124        // });
125	});
126
127	$('#catalogSlideButton').on('click', function() {
128		if(index_body == 0) {
129			$('body').css({'overflow' : 'hidden'});
130			index_body++;
131		} else {
132			$('body').css({'overflow' : 'auto'});
133			index_body--;
134		}
135	});
136
137	$('.depth-more').on('click', function() {
138		var id = $(this).attr('id');
139		var number = id.substr(id.indexOf('_') + 1, id.lenght);
140		
141		if($('#depth-2-' + number).css('display') == 'none') {
142			$('#depth-2-' + number).fadeIn();
143			$(this).parent('li').children('a').children('svg').css({'transform' : 'rotate(90deg)'});
144		} else {
145			$('#depth-2-' + number).fadeOut();
146			$(this).parent('li').children('a').children('svg').css({'transform' : 'rotate(0deg)'});
147		}
148	});
149
150	if(window.innerWidth <= 672) $('.tags-block-wrap-custom').addClass('tags-block-wrap');
151
152	$wrap = $('.tags-block-wrap')
153	var options = {
154		horizontal: true,
155		itemNav: 'centered',
156		smart: true,
157		activateOn: null,
158		mouseDragging: true,
159		touchDragging: true,
160		releaseSwing: true,
161		activateMiddle: true,
162		speed: 2500,
163		elasticBounds: 1,
164		easing: 'easeOutExpo',
165		dragHandle: 1,
166		dynamicHandle: 1,
167		clickBar: 1,
168		scrollSource: null,
169
170		// Buttons
171		prevPage: $wrap.find('.prevPage'),
172		nextPage: $wrap.find('.nextPage')
173	};
174	$('.tags-block-wrap .tags-block').sly(options);
175	$('.tags-block-wrap').addClass('active')
176
177
178	$('.level2-more').on('click', function(){
179		$(this).prev('ul').addClass('active')
180		$(this).hide()
181	})
182
183	$(document).on('click', '.eChild > .arrow', function(){
184		let $parent = $(this).closest('.eChild')
185		if($parent.hasClass('active')){
186			$('.eChild').removeClass('active')
187		}else{
188			$('.eChild').removeClass('active')
189			$parent.addClass('active')
190		}
191	})
192
193	$(document).on('click', '.level2__item .arrow', function(){
194		
195		let $parent = $(this).closest('.level2__item')
196		console.log($(this).closest('.level2__item'))
197		if($parent.hasClass('active')){
198			$('.level2__item').removeClass('active')
199		}else{
200			$('.level2__item').removeClass('active')
201			$parent.addClass('active')
202		}
203	})
204
205	$('.faq-item').on('click', function(){
206		$(this).toggleClass('opened')
207	})
208	
209	$('.recoment-slider').owlCarousel({
210		loop:true,
211		nav:true,
212		responsive:{
213			0:{
214				items:1
215			},
216			600:{
217				items:3
218			},
219			1000:{
220				items:4
221			}
222		}
223	})
224
225	$('.main-baner').owlCarousel({
226		loop:true,
227		nav:true,
228		items:1,
229		margin:3,
230		dots:false,
231		autoplay:true,
232		autoplayTimeout:5000
233	})
234	
235	// табы на главной
236	$('.new-tabs__nav li').on('click', function(){
237		if(!$(this).hasClass('active')){
238			$(this).closest('.buket-tabs').find('.new-tabs__nav li').removeClass('active')
239			$(this).addClass('active')
240			var index = $(this).index()
241
242			$(this).closest('.buket-tabs').find('.new-tabs__content').hide()
243			$(this).closest('.buket-tabs').find('.new-tabs__content').eq(index).fadeIn()
244		}
245	})
246
247	$('.next-step').on('click', function(){
248		var index = $(this).closest('.buket-tabs').find('.new-tabs__nav li.active').index() + 1
249		$(this).closest('.buket-tabs').find('.new-tabs__nav li').eq(index).click()
250	})
251
252	$('.podbor .new-tabs__nav li').on('click', function(){
253		$('.podbor-wrap__title').text($(this).text())
254	})
255
256	$('.two-tabs__nav li').on('click', function(){
257		if(!$(this).hasClass('active')){
258			$(this).closest('.two-tabs').find('.two-tabs__nav li').removeClass('active')
259			$(this).addClass('active')
260			var index = $(this).index()
261
262			$(this).closest('.two-tabs').find('.two-tabs__content').hide()
263			$(this).closest('.two-tabs').find('.two-tabs__content').eq(index).fadeIn()
264		}
265	})
266
267	$('#open-n-modal').on('click', function(){
268		$('.n-modal').fadeIn()
269	})
270
271	$('.n-modal__close').on('click', function(){
272		$('.n-modal').fadeOut()
273	})
274
275	$('#main-shop-review-form').on('submit', function(e){
276		e.preventDefault()
277		$('#main-shop-review-form-senk').fadeIn()
278	})
279
280	$('#shop-review-message-window-exit').on('click', function(){
281		$('.n-modal').fadeOut()
282	})
283
284	$(document).on('click', '.buy-click', function(){
285		$('.buy-click__modal').addClass('active');
286		$('.buy-modal').addClass('active');
287	});
288
289	$(document).on('click', '#buy-modal__close', function(){
290		$('.buy-click__modal').removeClass('active');
291	});
292
293	$(document).on('click', '.buy-modal__btn', function(){
294		$('.buy-modal').removeClass('active');
295		$('.modal-done').addClass('active');
296	});
297	
298	$(document).on('click', '#modal-done__close', function(){
299		$('.modal-done').removeClass('active');
300		$('.buy-click__modal').removeClass('active');
301	});
302
303	function refreshArcticle(){
304		if($(window).width()>1024){
305			$('.articles').insertAfter($('#smartFilter'))
306		}else{
307			$('.articles').insertAfter($('#catalogColumn'))
308		}
309	}
310	refreshArcticle()
311	$(window).on('resize', function(){
312		refreshArcticle()
313	});
314
315	$( "#ORDER_FORM" ).submit(function(e) {
316		ym(87384994,'reachGoal','ORDER_FORM');
317		ym(87384994,'reachGoal','allForm');
318		console.log('ORDER_FORM');
319	});
320
321	$( "#fastOrderForm" ).submit(function() {
322		ym(87384994,'reachGoal','fastOrderForm');
323		ym(87384994,'reachGoal','allForm');
324		console.log('fastOrderForm');
325	});
326
327	$( "#fastBuyForm" ).submit(function() {
328		ym(87384994,'reachGoal','fastBuyForm');
329		ym(87384994,'reachGoal','allForm');
330		console.log('fastBuyForm');
331	});
332
333	$( "#formPhone" ).submit(function(e) {
334		ym(87384994,'reachGoal','formPhone');
335		ym(87384994,'reachGoal','allForm');
336		console.log('formPhone');
337	});
338
339	$( "form[name='SIMPLE_FORM_1']").submit(function() {
340		ym(87384994,'reachGoal','SIMPLE_FORM_1');
341		ym(87384994,'reachGoal','allForm');
342		console.log('SIMPLE_FORM_1');
343	});
344
345	$(document).on('click', '*[data-b24-crm-button-widget="openline_livechat"]', function(){
346		ym(87384994,'reachGoal','livechat');
347		ym(87384994,'reachGoal','allForm');
348		console.log('livechat');
349	});
350});

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.