PageSourceSearch

https://www.bitrix24.co/bitrix/templates/bitrix24_2017/components/…/asset/js/articles/articles.js

js bitrix24.co collected 2026-09-30 20:37:34 UTC 2,462 bytes, 88 lines download raw bytes

1BX.ready(function (){
2	const dropdown = document.querySelector('.articles__bages-dropdown');
3	const dropdownSvg = dropdown.querySelector('.articles__bages-dropdown-svg');
4	const dropdownTitle = dropdown.querySelector('.articles__bages-dropdown-title');
5	const wrapper = dropdown.querySelector('.articles__bages-wrappper');
6	const items = wrapper.querySelectorAll('.articles__bage');
7	const defaultTitle = dropdownTitle.textContent.trim();
8
9	if (window.innerWidth < 768) {
10		function toggleDropdown() {
11			const isOpen = dropdown.classList.contains('open');
12			if (isOpen) {
13			dropdown.classList.remove('open');
14			dropdownSvg.classList.remove('active');
15			} else {
16			dropdown.classList.add('open');
17			dropdownSvg.classList.add('active');
18			}
19		}
20
21		dropdownSvg.addEventListener('click', toggleDropdown);
22
23		items.forEach(item => {
24			item.addEventListener('click', () => {
25				let isActive = item.classList.contains('active');
26
27				if (isActive) {
28					item.classList.remove('active');
29					setTimeout(() => {
30						dropdownTitle.textContent = defaultTitle;
31					}, 200);
32				} else {
33					items.forEach(i => i.classList.remove('active'));
34					item.classList.add('active');
35
36					let text = item.querySelector('.articles__bage-text').textContent.trim();
37					setTimeout(() => {
38						dropdownTitle.textContent = text;
39					}, 200);
40				}
41
42				dropdown.classList.remove('open');
43				dropdownSvg.classList.remove('active');
44			});
45		});
46
47		document.addEventListener('click', (e) => {
48			if (!dropdown.contains(e.target)) {
49			dropdown.classList.remove('open');
50			dropdownSvg.classList.remove('open');
51			}
52		});
53	} else {
54		document.querySelectorAll('.articles__bage').forEach(function(element) {
55			element.addEventListener('click', function() {
56				document.querySelectorAll('.articles__bage.active').forEach(el => {
57				if (el !== element) {
58					el.classList.remove('active');
59				}
60				});
61				element.classList.toggle('active');
62			});
63		});
64	};
65
66	const sldAutors = function() {
67	const G1 = new Glide('.articles-slider__glide', {
68			type: 'carousel',
69			animationDuration: 500,
70			animationTimingFunc: 'ease-in-out',
71			perView: 3,
72			gap: 20,
73			direction: document.documentElement.getAttribute('dir') === 'rtl' ? 'rtl' : 'ltr',
74			breakpoints: {
75				992: {
76					perView: 2,
77				},
78				768: {
79					perView: 1,
80				}
81			}
82		})
83
84		G1.mount();
85	};
86
87	sldAutors();
88});

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.