PageSourceSearch

https://lkg.ru/bitrix/templates/aspro_max/js/blocks/blocks.js?17164655377762

js lkg.ru collected 2026-10-08 03:30:26 UTC 7,762 bytes, 227 lines download raw bytes

1$(document).ready(function(){
2	//dropdown-select
3		$(document).on('click', '.dropdown-select .dropdown-select__title', function(){
4			var _this = $(this),
5				menu = _this.parent().find('> .dropdown-select__list'),
6				bVisibleMeu = (menu.is(':visible')),
7				animate = (!bVisibleMeu ? 'transition.slideUpIn' : 'fadeOut');
8
9			if(!_this.hasClass('clicked'))
10			{
11				_this.addClass('clicked');
12
13				menu.velocity('stop').velocity(animate, {
14					duration: 300,
15					// delay: 250,
16					begin: function(){
17						_this.toggleClass('opened');
18					},
19					complete: function(){
20						_this.removeClass('clicked');
21					}
22				});
23			}
24		})
25
26		// close select
27		$("html, body").on('mousedown', function(e){
28			if(typeof e.target.className == 'string' && e.target.className.indexOf('adm') < 0)
29			{
30				e.stopPropagation();
31
32				if(!$(e.target).closest('.dropdown-select').length)
33				{
34					$('.dropdown-select .dropdown-select__title.opened').click();
35				}
36			}
37		})
38	/**/
39
40
41	/*side head block*/
42	$(document).on('click', '.slide-block .slide-block__head', function(e){
43		var _this = $(this),
44			menu = _this.siblings('.slide-block__body'),
45			bVisibleMeu = (menu.is(':visible')),
46			animate = (bVisibleMeu ? 'slideUp' : 'slideDown');
47
48		if(!_this.hasClass('clicked') && menu.length && !_this.hasClass('ignore') && !$(e.target).attr('href'))
49		{
50			var type = _this.data('id');
51			_this.addClass('clicked');
52
53			if(bVisibleMeu)
54				$.cookie(type+'_CLOSED', 'Y');
55			else
56				$.removeCookie(type+'_CLOSED');
57
58			menu.velocity('stop').velocity(animate, {
59				duration: 150,
60				// delay: 250,
61				begin: function(){
62					_this.toggleClass('closed');
63				},
64				complete: function(){
65					_this.removeClass('clicked');
66					
67					if(typeof window['stickySidebar'] !== 'undefined')
68						window['stickySidebar'].updateSticky();
69				}
70			});
71		}
72	})
73	/**/
74
75	/*sku change props*/
76	if(!('SelectOfferProp' in window) && typeof window.SelectOfferProp != 'function')
77	{
78		SelectOfferProp = function(){
79			// return false;
80			var _this = $(this),
81				obParams = {},
82				obSelect = {},
83				objUrl = parseUrlQuery(),
84				add_url = '',
85				selectMode = (_this.hasClass('list_values_wrapper') ? true : false),
86				container = _this.closest('.bx_catalog_item_scu'),
87				img = _this.closest('.item-parent').find('.thumb img');
88
89			/* request params */
90			obParams = {
91				'PARAMS': _this.closest('.js_wrapper_items').data('params'),
92				'ID': container.data('offer_id'),
93				'SITE_ID': container.data('site_id'),
94				'LINK_ID': container.data('id')+'_'+_this.closest('.cur').data('code'),
95				'IBLOCK_ID': container.data('offer_iblockid'),
96				'PROPERTY_ID': container.data('propertyid'),
97				'DEPTH': _this.closest('.item_wrapper').index(),
98				'VALUE': (selectMode ? _this.find('option:selected').data('onevalue') : _this.data('onevalue')),
99				'CLASS': 'inner_content',
100				'PICTURE': (img.data('src') ? img.data('src') : img.attr('src')),
101				'ARTICLE_NAME': _this.closest('.item-parent').find('.article_block').data('name'),
102				'ARTICLE_VALUE': _this.closest('.item-parent').find('.article_block').data('value'),
103			}
104			/**/
105
106			if("clear_cache" in objUrl)
107			{
108				if(objUrl.clear_cache == "Y")
109					add_url += "?clear_cache=Y";
110			}
111
112			/* save selected values */
113			for (i = 0; i < obParams.DEPTH+1; i++)
114			{
115				strName = 'PROP_'+container.find('.item_wrapper:eq('+i+') > div').data('id');
116				if(container.find('.item_wrapper:eq('+i+') select').length)
117				{
118					obSelect[strName] = container.find('.item_wrapper:eq('+i+') select option:selected').data('onevalue');
119					obParams[strName] = container.find('.item_wrapper:eq('+i+') select option:selected').data('onevalue');
120				}
121				else
122				{
123					obSelect[strName] = container.find('.item_wrapper:eq('+i+') li.item.active').data('onevalue');
124					obParams[strName] = container.find('.item_wrapper:eq('+i+') li.item.active').data('onevalue');
125				}
126			}
127
128			// obParams.SELECTED = JSON.stringify(obSelect);
129			/**/
130			
131			if(!selectMode)
132			{
133				_this.siblings().removeClass('active');
134				_this.addClass('active');
135			}
136
137			if(_this.attr('title'))
138			{
139				_this.closest('.item_wrapper').find('.show_class span').text(_this.attr('title'))
140			}
141			else
142			{
143				var img_row = _this.find(' > i');
144				if(img_row.length && img_row.attr('title'))
145					_this.closest('.item_wrapper').find('.show_class span').text(img_row.attr('title'))
146			}
147
148			/* get sku */
149			$.ajax({
150				url: arMaxOptions['SITE_DIR']+'ajax/js_item_detail.php'+add_url,
151				type: 'POST',
152				data: obParams,
153			}).success(function(html){
154				var ob = BX.processHTML(html);BX.ajax.processScripts(ob.SCRIPT);
155				if($('.counter_wrapp.list'))
156				{
157					$('.counter_wrapp.list .counter_block.big').removeClass('big');
158				}
159			})
160		}
161		$(document).on('click', '.ajax_load .bx_catalog_item_scu li.item', SelectOfferProp)
162		$(document).on('change', '.ajax_load .bx_catalog_item_scu select.list_values_wrapper', SelectOfferProp)
163	}
164
165	/**/
166
167	/**/
168	$('.switch-item-block .switch-item-block__icons').on('click', function(){
169		var $this = $(this),
170			animationTime = 200;
171
172		if($this.hasClass('switch-item-block__icons--small') && !$this.hasClass('active')){
173			$this.addClass('active');
174			$this.siblings('.switch-item-block__icons--big').removeClass('active');
175			$this.closest('.switch-item-block').find('.switch-item-block__count-wrapper--big').fadeOut(animationTime, function(){
176				$this.closest('.switch-item-block').find('.switch-item-block__count-wrapper--small').fadeIn(animationTime);
177			});
178
179			$this.closest('.switch-item-block').siblings('.big-gallery-block').fadeOut(animationTime, function(){
180				$this.closest('.switch-item-block').siblings('.small-gallery-block').fadeIn(animationTime);
181			});
182		}
183		else if($this.hasClass('switch-item-block__icons--big') && !$this.hasClass('active')){
184			$this.addClass('active');
185			$this.siblings('.switch-item-block__icons--small').removeClass('active');
186			$this.closest('.switch-item-block').find('.switch-item-block__count-wrapper--small').fadeOut(animationTime, function(){
187				$this.closest('.switch-item-block').find('.switch-item-block__count-wrapper--big').fadeIn(animationTime);
188			});
189
190			$this.closest('.switch-item-block').siblings('.small-gallery-block').fadeOut(animationTime, function(){
191				$this.closest('.switch-item-block').siblings('.big-gallery-block').fadeIn(animationTime);
192			});
193		}
194		setTimeout(function(){
195			InitLazyLoad();
196		}, 300);
197	});
198	/**/
199
200	/*many items menu*/
201
202	$('.menu-navigation__sections-wrapper .menu-navigation__sections').menuAim({
203        firstActiveRow: true,
204        rowSelector: "> .menu-navigation__sections-item",
205        activate: function activate(a) {
206            var _this = $(a),
207                index = _this.index(),
208                items = _this.closest('.menu-navigation__sections-wrapper').next(),
209                link = _this.find('> a');
210
211            _this.siblings().find('> a').addClass('dark_link')
212            link.addClass('colored_theme_text').removeClass('dark_link');
213            items.find('.parent-items').siblings().hide();
214            items.find('.parent-items').eq(index).show();
215        },
216        deactivate: function deactivate(a) {
217            var _this = $(a),
218                index = _this.index(),
219                items = _this.closest('.menu-navigation__sections-wrapper').next(),
220                link = _this.find('> a');
221                
222          link.removeClass('colored_theme_text').addClass('dark_link');
223          items.find('.parent-items').siblings().hide();
224        }
225    });
226	/**/
227})

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.