PageSourceSearch

https://www.chuc.ru/bitrix/templates/modern_blue_2024/js/main.js?17908777647149

js chuc.ru collected 2026-10-04 03:25:05 UTC 7,149 bytes, 233 lines download raw bytes

1// Определяем переменную для экономии памяти.
2var doc = $(document),
3	menuTimer;
4
5doc
6	.on('click keypress', '.search-button', function(e) {
7		if (e.type == 'keypress' && e.which != 13) {
8			return;
9		}
10		if(e.type == 'keypress' && e.which == 13) {
11			$('.container-search').find('.search-input').addClass('tabindex');
12		}
13		// Обработка нажатия на кнопку поиска
14		$('.container-search').addClass('opened').find('.search-input').focus();
15	})
16	.on('click', '.search-close-button', function(e) {
17		// Обработка нажатия на кнопку закрытия поиска
18		$('.container-search').removeClass('opened');
19	})
20	.on('blur', '.search-input.tabindex', function() {
21		if ($(this).val() == '') {
22			$(this).closest('.container-search').removeClass('opened');
23			$('.search-button').focus();
24		};
25	})
26	.on('input', '.search-input', function() {
27		/**
28		 * @todo Этот код необходимо удалить, он тут только для демонстрации поведения поиска
29		 */
30		if ($(this).val() != '') {
31			$('.search-suggestions').slideDown(500);
32		} else {
33			$('.search-suggestions').slideUp(300)
34		}
35	})
36	.on('click', '.mobile-navrazdel .parent > a', function(e) {
37		e.preventDefault();
38
39		var $this = $(this),
40			$parent = $this.closest('.parent');
41
42		if ($parent.hasClass('active')) {
43			$parent.removeClass('active');
44		} else {
45			$parent.addClass('active').siblings().removeClass('active');
46		}
47
48		return false;
49	})
50		.on('click', '.mobile-nav .parent > a', function(e) {
51		e.preventDefault();
52
53		var $this = $(this),
54			$parent = $this.closest('.parent');
55
56		if ($parent.hasClass('active')) {
57			$parent.removeClass('active');
58		} else {
59			$parent.addClass('active').siblings().removeClass('active');
60		}
61
62		return false;
63	})
64    .on('click', '.top-nav-block .parent > a', function(e) {
65        var parent = $(this).parent();
66        if (!parent.hasClass('active')) {
67            e.preventDefault();
68            parent.addClass('active').siblings().removeClass('active');
69        }
70    })
71    .on('keydown', '.top-nav-block', function(e) {
72        if (e.key === 'Escape') {
73            $(this).find('.active').removeClass('active');
74            $(e.target).closest('.parent').children('a').first().focus();
75        }
76    })
77    .on('click', function(e) {
78        if (!$(e.target).closest('.top-nav-block').length) {
79            $('.top-nav-block .active').removeClass('active');
80        }
81    })	.on('input keyup', '.jq-selectbox__search input', function(e) {
82		// Обработка клика и тача по родительским пунктам меню
83		if (e.type == 'input') {
84			// $(this).off('keyup');
85		}
86		$(this).closest('ul').perfectScrollbar('update');
87
88	})
89	.on('click', '.toggle-next', function(e) {
90		// Сворачивание/разворачивание следующего за текущим элемента
91		e.preventDefault();
92		$(this).toggleClass('opened').next().slideToggle(500);
93	})
94	.on('click', '.vertical-filter-header', function(e) {
95		// Сворачиваем/разворачиваем блоки в вертикальном фильтре
96		var $this = $(this),
97			$parent = $this.closest('.vertical-filter-box');
98		$this.next().slideToggle(500, function () {
99			$('.styler').trigger('refresh'); // обновляем стилизацию селекта
100			$parent.toggleClass('active');
101		})
102	})
103	.on('click', '.info-box-close', function(event) {
104		// Закрываем инфо-полоску
105		event.preventDefault();
106		$(this).closest('.info-box').slideUp(200);
107	})
108	.on('click', '[data-schedule-modal]', function(event) {
109		// Показываем модальное окно с подробностями в расписании 
110		var url = $(this).data('scheduleModal');
111		$.magnificPopup.open({
112			items: {
113				src: url
114			},
115			type: 'ajax'
116		});
117	})
118	.on('touchend', '.footer-menu-content ul .h4', function(event) {
119		// Сворачиваем/разворачиваем меню в футере сайта только на тач-устройствах	
120		$(this).toggleClass('opened').next().slideToggle(500);
121	})
122	.on('click', '.sidebar-navrazdel .parent > a', function(e) {
123		// Меню в сайдбаре
124		e.preventDefault();
125		var $this = $(this),
126			$parent = $(this).parent();
127
128		if ($parent.hasClass('current')) {
129			$parent.removeClass('current');
130		} else {
131			$('.sidebar-navrazdel .parent').removeClass('current');
132			$parent.addClass('current');
133		}
134		return false;
135	})
136	// При первом наведении на блок с меню делаем задержку для предотвращения случайного показа пунктов
137	.on('mouseenter', '.top-nav-block', function() {
138		var $this = $(this);
139		if (menuTimer) {
140			clearTimeout(menuTimer);
141			menuTimer = null
142		}
143		menuTimer = setTimeout(function () {
144			$this.addClass('hovered');
145		}, 400);
146
147	})
148	.on('mouseleave', '.top-nav-block', function() {
149		if (menuTimer) {
150			clearTimeout(menuTimer);
151			menuTimer = null
152		}
153		$(this).removeClass('hovered');
154
155	});
156
157
158
159jQuery(function () { mainJsFile(); });
160if (window.frameCacheVars !== undefined) {
161	// Композит
162	BX.addCustomEvent("onFrameDataReceived", function (json) {
163		mainJsFile();
164	});
165}
166else {
167	// Обычный режим
168	jQuery(document).ready(function ($) {
169		mainJsFile();
170	});
171}
172
173// Основной js-код, выполняемый при загрузке страницы
174function mainJsFile() {
175	// Строим мобильную навигацию
176	$.simpleMobileNav({
177		navBlock: '.top-nav-block > ul',
178		navContainer: '.mobile-nav',
179		navWrapper: '.mobile-nav-wrapper',
180		navRazdelBlock: '.sidebar-navrazdel > ul',
181		navRazdelContainer: '.mobile-navrazdel',
182		navRazdelWrapper: '.mobile-navrazdel-wrapper'
183	});
184	
185	
186	// Слайдер на главной странице
187	$('.big-slider').owlCarousel({
188		items: 1,
189		navContainer: '.big-slider-nav',
190		navText: ['Назад', 'Ещё'],
191		responsive: {
192			0: {
193				nav: false,
194				dots: true
195			},
196			768: {
197				nav: true,
198				dots: false
199			}
200		}
201	});
202
203	// Стилизация селектов
204	$('.styler').styler({
205		selectSearch: true,
206		selectSearchLimit: 20,
207		onSelectOpened: function() {
208			// к открытому применяем плагин стилизации скроллбара
209			$(this).find('ul').perfectScrollbar();
210			// console.log('onSelectOpened', $(this).find('ul').html());
211		},
212		onFormStyled: function () {
213			$('.jq-selectbox').addClass('opacity-one');
214		}
215	});
216
217	// Одинаковая высота блоков
218	$('.equal').matchHeight();
219
220	// Заворачиваем таблицы в блоки для прокрутки на мелких экранах
221	var $tables = $('.table').not('.table-schedule').not('.table-schedule table');
222	if ($tables.length) {
223		$.each($tables, function(index, val) {
224			var $this = $(this);
225			if (!$this.parent().hasClass('responsive-table')) { $this.wrap('<div class="responsive-table" />'); }
226		});
227		$('.responsive-table').perfectScrollbar();
228	};
229
230
231}
232
233

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.