PageSourceSearch

https://raduga-light.com/bitrix/cache/js/nn/radnext/page_45b6e3dd1…29bb0d12740db2e077d48_v1.js?178319303124548

js raduga-light.com collected 2026-10-08 12:43:51 UTC 24,548 bytes, 962 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:130:"/bitrix/templates/radnext/components/bitrix/catalog/news_raduga_next/bitrix/catalog.smart.filter/catalog/script.js?167809514824055";s:6:"source";s:114:"/bitrix/templates/radnext/components/bitrix/catalog/news_raduga_next/bitrix/catalog.smart.filter/catalog/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3function JCSmartFilter(ajaxURL, viewMode, params)
4{
5	this.ajaxURL = ajaxURL;
6	this.form = null;
7	this.timer = null;
8	this.cacheKey = '';
9	this.cache = [];
10	this.popups = [];
11	this.viewMode = viewMode;
12	if (params && params.SEF_SET_FILTER_URL)
13	{
14		this.bindUrlToButton('set_filter', params.SEF_SET_FILTER_URL);
15		this.sef = true;
16	}
17	if (params && params.SEF_DEL_FILTER_URL)
18	{
19		this.bindUrlToButton('del_filter', params.SEF_DEL_FILTER_URL);
20	}
21}
22
23JCSmartFilter.prototype.keyup = function(input)
24{
25	if(!!this.timer)
26	{
27		clearTimeout(this.timer);
28	}
29	this.timer = setTimeout(BX.delegate(function(){
30		this.reload(input);
31	}, this), 500);
32};
33
34JCSmartFilter.prototype.click = function(checkbox)
35{
36	if(!!this.timer)
37	{
38		clearTimeout(this.timer);
39	}
40
41	this.timer = setTimeout(BX.delegate(function(){
42		this.reload(checkbox);
43	}, this), 500);
44};
45
46JCSmartFilter.prototype.reload = function(input)
47{
48	if (this.cacheKey !== '')
49	{
50		//Postprone backend query
51		if(!!this.timer)
52		{
53			clearTimeout(this.timer);
54		}
55		this.timer = setTimeout(BX.delegate(function(){
56			this.reload(input);
57		}, this), 1000);
58		return;
59	}
60	this.cacheKey = '|';
61
62	this.position = BX.pos(input, true);
63	this.form = BX.findParent(input, {'tag':'form'});
64	if (this.form)
65	{
66		var values = [];
67		values[0] = {name: 'ajax', value: 'y'};
68		this.gatherInputsValues(values, BX.findChildren(this.form, {'tag': new RegExp('^(input|select)$', 'i')}, true));
69
70		for (var i = 0; i < values.length; i++)
71			this.cacheKey += values[i].name + ':' + values[i].value + '|';
72
73		if (this.cache[this.cacheKey])
74		{
75			this.curFilterinput = input;
76			this.postHandler(this.cache[this.cacheKey], true);
77		}
78		else
79		{
80			if (this.sef)
81			{
82				var set_filter = BX('set_filter');
83				set_filter.disabled = true;
84			}
85
86			this.curFilterinput = input;
87			BX.ajax.loadJSON(
88				this.ajaxURL,
89				this.values2post(values),
90				BX.delegate(this.postHandler, this)
91			);
92		}
93	}
94};
95
96JCSmartFilter.prototype.updateItem = function (PID, arItem)
97{
98	if (arItem.PROPERTY_TYPE === 'N' || arItem.PRICE)
99	{
100		var trackBar = window['trackBar' + PID];
101		if (!trackBar && arItem.ENCODED_ID)
102			trackBar = window['trackBar' + arItem.ENCODED_ID];
103
104		if (trackBar && arItem.VALUES)
105		{
106			if (arItem.VALUES.MIN)
107			{
108				if (arItem.VALUES.MIN.FILTERED_VALUE)
109					trackBar.setMinFilteredValue(arItem.VALUES.MIN.FILTERED_VALUE);
110				else
111					trackBar.setMinFilteredValue(arItem.VALUES.MIN.VALUE);
112			}
113
114			if (arItem.VALUES.MAX)
115			{
116				if (arItem.VALUES.MAX.FILTERED_VALUE)
117					trackBar.setMaxFilteredValue(arItem.VALUES.MAX.FILTERED_VALUE);
118				else
119					trackBar.setMaxFilteredValue(arItem.VALUES.MAX.VALUE);
120			}
121		}
122	}
123	else if (arItem.VALUES)
124	{
125		for (var i in arItem.VALUES)
126		{
127			if (arItem.VALUES.hasOwnProperty(i))
128			{
129				var value = arItem.VALUES[i];
130				var control = BX(value.CONTROL_ID);
131
132				if (!!control)
133				{
134					var label = document.querySelector('[data-role="label_'+value.CONTROL_ID+'"]');
135					if (value.DISABLED)
136					{
137						if (label)
138							BX.addClass(label, 'disabled');
139						else
140							BX.addClass(control.parentNode, 'disabled');
141					}
142					else
143					{
144						if (label)
145							BX.removeClass(label, 'disabled');
146						else
147							BX.removeClass(control.parentNode, 'disabled');
148					}
149
150					if (value.hasOwnProperty('ELEMENT_COUNT'))
151					{
152						label = document.querySelector('[data-role="count_'+value.CONTROL_ID+'"]');
153						if (label)
154							label.innerHTML = value.ELEMENT_COUNT;
155					}
156				}
157			}
158		}
159	}
160};
161
162JCSmartFilter.prototype.postHandler = function (result, fromCache)
163{
164	var hrefFILTER, url, curProp;
165	var modef = BX('modef');
166	var modef_num = BX('modef_num');
167
168	if (!!result && !!result.ITEMS)
169	{
170		for(var popupId in this.popups)
171		{
172			if (this.popups.hasOwnProperty(popupId))
173			{
174				this.popups[popupId].destroy();
175			}
176		}
177		this.popups = [];
178
179		for(var PID in result.ITEMS)
180		{
181			if (result.ITEMS.hasOwnProperty(PID))
182			{
183				this.updateItem(PID, result.ITEMS[PID]);
184			}
185		}
186
187		if (!!modef && !!modef_num)
188		{
189			modef_num.innerHTML = result.ELEMENT_COUNT;
190			hrefFILTER = BX.findChildren(modef, {tag: 'A'}, true);
191
192			if (result.FILTER_URL && hrefFILTER)
193			{
194				hrefFILTER[0].href = BX.util.htmlspecialcharsback(result.FILTER_URL);
195			}
196
197			if (result.FILTER_AJAX_URL && result.COMPONENT_CONTAINER_ID)
198			{
199				BX.unbindAll(hrefFILTER[0]);
200				BX.bind(hrefFILTER[0], 'click', function(e)
201				{
202					url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL);
203					BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID);
204					return BX.PreventDefault(e);
205				});
206			}
207
208			if (result.INSTANT_RELOAD && result.COMPONENT_CONTAINER_ID)
209			{
210				url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL);
211				BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID);
212			}
213			else
214			{
215			/*	if (modef.style.display === 'none')
216				{
217					modef.style.display = 'inline-block';
218				}
219*/
220$.get(
221    BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL), 
222    function (data) {
223	history.pushState({}, null, 'https://raduga-light.com'+BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL));
224	   $('.projectsfilter').html($(data).find('.projectsfilter').html());
225        $('.page-section').html($(data).find('.page-section').html());
226    }
227);
228
229
230				if (this.viewMode == "VERTICAL")
231				{
232					curProp = BX.findChild(BX.findParent(this.curFilterinput, {'class':'bx-filter-parameters-box'}), {'class':'bx-filter-container-modef'}, true, false);
233					curProp.appendChild(modef);
234				}
235
236				if (result.SEF_SET_FILTER_URL)
237				{
238					this.bindUrlToButton('set_filter', result.SEF_SET_FILTER_URL);
239				}
240			}
241		}
242	}
243
244	if (this.sef)
245	{
246		var set_filter = BX('set_filter');
247		set_filter.disabled = false;
248	}
249
250	if (!fromCache && this.cacheKey !== '')
251	{
252		this.cache[this.cacheKey] = result;
253	}
254	this.cacheKey = '';
255};
256
257JCSmartFilter.prototype.bindUrlToButton = function (buttonId, url)
258{
259	var button = BX(buttonId);
260	if (button)
261	{
262		var proxy = function(j, func)
263		{
264			return function()
265			{
266				return func(j);
267			}
268		};
269
270		if (button.type == 'submit')
271			button.type = 'button';
272
273		BX.bind(button, 'click', proxy(url, function(url)
274		{
275			window.location.href = url;
276			return false;
277		}));
278	}
279};
280
281JCSmartFilter.prototype.gatherInputsValues = function (values, elements)
282{
283	if(elements)
284	{
285		for(var i = 0; i < elements.length; i++)
286		{
287			var el = elements[i];
288			if (el.disabled || !el.type)
289				continue;
290
291			switch(el.type.toLowerCase())
292			{
293				case 'text':
294				case 'textarea':
295				case 'password':
296				case 'hidden':
297				case 'select-one':
298					if(el.value.length)
299						values[values.length] = {name : el.name, value : el.value};
300					break;
301				case 'radio':
302				case 'checkbox':
303					if(el.checked)
304						values[values.length] = {name : el.name, value : el.value};
305					break;
306				case 'select-multiple':
307					for (var j = 0; j < el.options.length; j++)
308					{
309						if (el.options[j].selected)
310							values[values.length] = {name : el.name, value : el.options[j].value};
311					}
312					break;
313				default:
314					break;
315			}
316		}
317	}
318	
319	
320};
321
322JCSmartFilter.prototype.values2post = function (values)
323{
324	var post = [];
325	var current = post;
326	var i = 0;
327
328	while(i < values.length)
329	{
330		var p = values[i].name.indexOf('[');
331		if(p == -1)
332		{
333			current[values[i].name] = values[i].value;
334			current = post;
335			i++;
336		}
337		else
338		{
339			var name = values[i].name.substring(0, p);
340			var rest = values[i].name.substring(p+1);
341			if(!current[name])
342				current[name] = [];
343
344			var pp = rest.indexOf(']');
345			if(pp == -1)
346			{
347				//Error - not balanced brackets
348				current = post;
349				i++;
350			}
351			else if(pp == 0)
352			{
353				//No index specified - so take the next integer
354				current = current[name];
355				values[i].name = '' + current.length;
356			}
357			else
358			{
359				//Now index name becomes and name and we go deeper into the array
360				current = current[name];
361				values[i].name = rest.substring(0, pp) + rest.substring(pp+1);
362			}
363		}
364	}
365	return post;
366};
367JCSmartFilter.prototype.hideFilterProps2 = function(element)
368{
369	var obj = element.parentNode,
370		filterBlock = obj.querySelector("[data-role='hiddenels']"),
371		propAngle = obj.querySelector("[data-role='prop_angle']"),
372		showmore = obj.querySelector("[data-role='showmore']"),
373		showless = obj.querySelector("[data-role='showless']")
374		;
375
376	if(BX.hasClass(filterBlock, "bx-active"))
377	{
378		new BX.easing({
379			duration : 300,
380			start : { opacity: 1,  height: filterBlock.offsetHeight },
381			finish : { opacity: 0, height:0 },
382			transition : BX.easing.transitions.quart,
383			step : function(state){
384				filterBlock.style.opacity = state.opacity;
385				filterBlock.style.height = state.height + "px";
386			},
387			complete : function() {
388				filterBlock.setAttribute("style", "");
389				BX.removeClass(filterBlock, "bx-active");
390			}
391		}).animate();
392
393		
394		BX.addClass(showless, "hiddenel");
395		BX.removeClass(showmore, "hiddenel");
396		
397		BX.addClass(propAngle, "fa-angle-down");
398		BX.removeClass(propAngle, "fa-angle-up");
399	}
400	else
401	{
402		filterBlock.style.display = "block";
403		filterBlock.style.opacity = 0;
404		filterBlock.style.height = "auto";
405
406		var obj_children_height = filterBlock.offsetHeight;
407		filterBlock.style.height = 0;
408
409		new BX.easing({
410			duration : 300,
411			start : { opacity: 0,  height: 0 },
412			finish : { opacity: 1, height: obj_children_height },
413			transition : BX.easing.transitions.quart,
414			step : function(state){
415				filterBlock.style.opacity = state.opacity;
416				filterBlock.style.height = state.height + "px";
417					
418			},
419			complete : function() {
420			}
421		}).animate();
422
423
424	BX.addClass(showmore, "hiddenel");
425		BX.removeClass(showless, "hiddenel");
426		BX.addClass(filterBlock, "bx-active");
427		BX.removeClass(propAngle, "fa-angle-down");
428		BX.addClass(propAngle, "fa-angle-up");
429	}
430};
431JCSmartFilter.prototype.hideFilterProps = function(element)
432{
433	var obj = element.parentNode,
434		filterBlock = obj.querySelector("[data-role='bx_filter_block']"),
435		propAngle = obj.querySelector("[data-role='prop_angle']");
436
437	if(BX.hasClass(obj, "bx-active"))
438	{
439		new BX.easing({
440			duration : 300,
441			start : { opacity: 1,  height: filterBlock.offsetHeight },
442			finish : { opacity: 0, height:0 },
443			transition : BX.easing.transitions.quart,
444			step : function(state){
445				filterBlock.style.opacity = state.opacity;
446				filterBlock.style.height = state.height + "px";
447			},
448			complete : function() {
449				filterBlock.setAttribute("style", "");
450				BX.removeClass(obj, "bx-active");
451			}
452		}).animate();
453
454		BX.addClass(propAngle, "fa-angle-down");
455		BX.removeClass(propAngle, "fa-angle-up");
456	}
457	else
458	{
459		filterBlock.style.display = "block";
460		filterBlock.style.opacity = 0;
461		filterBlock.style.height = "auto";
462
463		var obj_children_height = filterBlock.offsetHeight;
464		filterBlock.style.height = 0;
465
466		new BX.easing({
467			duration : 300,
468			start : { opacity: 0,  height: 0 },
469			finish : { opacity: 1, height: obj_children_height },
470			transition : BX.easing.transitions.quart,
471			step : function(state){
472				filterBlock.style.opacity = state.opacity;
473				filterBlock.style.height = state.height + "px";
474			},
475			complete : function() {
476			}
477		}).animate();
478
479		BX.addClass(obj, "bx-active");
480		BX.removeClass(propAngle, "fa-angle-down");
481		BX.addClass(propAngle, "fa-angle-up");
482	}
483};
484
485JCSmartFilter.prototype.showDropDownPopup = function(element, popupId)
486{
487	var contentNode = element.querySelector('[data-role="dropdownContent"]');
488	this.popups["smartFilterDropDown"+popupId] = BX.PopupWindowManager.create("smartFilterDropDown"+popupId, element, {
489		autoHide: true,
490		offsetLeft: 0,
491		offsetTop: 3,
492		overlay : false,
493		draggable: {restrict:true},
494		closeByEsc: true,
495		content: BX.clone(contentNode)
496	});
497	this.popups["smartFilterDropDown"+popupId].show();
498};
499
500JCSmartFilter.prototype.selectDropDownItem = function(element, controlId)
501{
502	this.keyup(BX(controlId));
503
504	var wrapContainer = BX.findParent(BX(controlId), {className:"bx-filter-select-container"}, false);
505
506	var currentOption = wrapContainer.querySelector('[data-role="currentOption"]');
507	currentOption.innerHTML = element.innerHTML;
508	BX.PopupWindowManager.getCurrentPopup().close();
509};
510
511BX.namespace("BX.Iblock.SmartFilter");
512BX.Iblock.SmartFilter = (function()
513{
514	/** @param {{
515			leftSlider: string,
516			rightSlider: string,
517			tracker: string,
518			trackerWrap: string,
519			minInputId: string,
520			maxInputId: string,
521			minPrice: float|int|string,
522			maxPrice: float|int|string,
523			curMinPrice: float|int|string,
524			curMaxPrice: float|int|string,
525			fltMinPrice: float|int|string|null,
526			fltMaxPrice: float|int|string|null,
527			precision: int|null,
528			colorUnavailableActive: string,
529			colorAvailableActive: string,
530			colorAvailableInactive: string
531		}} arParams
532	 */
533	var SmartFilter = function(arParams)
534	{
535		if (typeof arParams === 'object')
536		{
537			this.leftSlider = BX(arParams.leftSlider);
538			this.rightSlider = BX(arParams.rightSlider);
539			this.tracker = BX(arParams.tracker);
540			this.trackerWrap = BX(arParams.trackerWrap);
541
542			this.minInput = BX(arParams.minInputId);
543			this.maxInput = BX(arParams.maxInputId);
544
545			this.minPrice = parseFloat(arParams.minPrice);
546			this.maxPrice = parseFloat(arParams.maxPrice);
547
548			this.curMinPrice = parseFloat(arParams.curMinPrice);
549			this.curMaxPrice = parseFloat(arParams.curMaxPrice);
550
551			this.fltMinPrice = arParams.fltMinPrice ? parseFloat(arParams.fltMinPrice) : parseFloat(arParams.curMinPrice);
552			this.fltMaxPrice = arParams.fltMaxPrice ? parseFloat(arParams.fltMaxPrice) : parseFloat(arParams.curMaxPrice);
553
554			this.precision = arParams.precision || 0;
555
556			this.priceDiff = this.maxPrice - this.minPrice;
557
558			this.leftPercent = 0;
559			this.rightPercent = 0;
560
561			this.fltMinPercent = 0;
562			this.fltMaxPercent = 0;
563
564			this.colorUnavailableActive = BX(arParams.colorUnavailableActive);//gray
565			this.colorAvailableActive = BX(arParams.colorAvailableActive);//blue
566			this.colorAvailableInactive = BX(arParams.colorAvailableInactive);//light blue
567
568			this.isTouch = false;
569
570			this.init();
571
572			if ('ontouchstart' in document.documentElement)
573			{
574				this.isTouch = true;
575
576				BX.bind(this.leftSlider, "touchstart", BX.proxy(function(event){
577					this.onMoveLeftSlider(event)
578				}, this));
579
580				BX.bind(this.rightSlider, "touchstart", BX.proxy(function(event){
581					this.onMoveRightSlider(event)
582				}, this));
583			}
584			else
585			{
586				BX.bind(this.leftSlider, "mousedown", BX.proxy(function(event){
587					this.onMoveLeftSlider(event)
588				}, this));
589
590				BX.bind(this.rightSlider, "mousedown", BX.proxy(function(event){
591					this.onMoveRightSlider(event)
592				}, this));
593			}
594
595			BX.bind(this.minInput, "keyup", BX.proxy(function(event){
596				this.onInputChange();
597			}, this));
598
599			BX.bind(this.maxInput, "keyup", BX.proxy(function(event){
600				this.onInputChange();
601			}, this));
602		}
603	};
604
605	SmartFilter.prototype.init = function()
606	{
607		var priceDiff;
608
609		if (this.curMinPrice > this.minPrice)
610		{
611			priceDiff = this.curMinPrice - this.minPrice;
612			this.leftPercent = (priceDiff*100)/this.priceDiff;
613
614			this.leftSlider.style.left = this.leftPercent + "%";
615			this.colorUnavailableActive.style.left = this.leftPercent + "%";
616		}
617
618		this.setMinFilteredValue(this.fltMinPrice);
619
620		if (this.curMaxPrice < this.maxPrice)
621		{
622			priceDiff = this.maxPrice - this.curMaxPrice;
623			this.rightPercent = (priceDiff*100)/this.priceDiff;
624
625			this.rightSlider.style.right = this.rightPercent + "%";
626			this.colorUnavailableActive.style.right = this.rightPercent + "%";
627		}
628
629		this.setMaxFilteredValue(this.fltMaxPrice);
630	};
631
632	SmartFilter.prototype.setMinFilteredValue = function (fltMinPrice)
633	{
634		this.fltMinPrice = parseFloat(fltMinPrice);
635		if (this.fltMinPrice >= this.minPrice)
636		{
637			var priceDiff = this.fltMinPrice - this.minPrice;
638			this.fltMinPercent = (priceDiff*100)/this.priceDiff;
639
640			if (this.leftPercent > this.fltMinPercent)
641				this.colorAvailableActive.style.left = this.leftPercent + "%";
642			else
643				this.colorAvailableActive.style.left = this.fltMinPercent + "%";
644
645			this.colorAvailableInactive.style.left = this.fltMinPercent + "%";
646		}
647		else
648		{
649			this.colorAvailableActive.style.left = "0%";
650			this.colorAvailableInactive.style.left = "0%";
651		}
652	};
653
654	SmartFilter.prototype.setMaxFilteredValue = function (fltMaxPrice)
655	{
656		this.fltMaxPrice = parseFloat(fltMaxPrice);
657		if (this.fltMaxPrice <= this.maxPrice)
658		{
659			var priceDiff = this.maxPrice - this.fltMaxPrice;
660			this.fltMaxPercent = (priceDiff*100)/this.priceDiff;
661
662			if (this.rightPercent > this.fltMaxPercent)
663				this.colorAvailableActive.style.right = this.rightPercent + "%";
664			else
665				this.colorAvailableActive.style.right = this.fltMaxPercent + "%";
666
667			this.colorAvailableInactive.style.right = this.fltMaxPercent + "%";
668		}
669		else
670		{
671			this.colorAvailableActive.style.right = "0%";
672			this.colorAvailableInactive.style.right = "0%";
673		}
674	};
675
676	SmartFilter.prototype.getXCoord = function(elem)
677	{
678		var box = elem.getBoundingClientRect();
679		var body = document.body;
680		var docElem = document.documentElement;
681
682		var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
683		var clientLeft = docElem.clientLeft || body.clientLeft || 0;
684		var left = box.left + scrollLeft - clientLeft;
685
686		return Math.round(left);
687	};
688
689	SmartFilter.prototype.getPageX = function(e)
690	{
691		e = e || window.event;
692		var pageX = null;
693
694		if (this.isTouch && event.targetTouches[0] != null)
695		{
696			pageX = e.targetTouches[0].pageX;
697		}
698		else if (e.pageX != null)
699		{
700			pageX = e.pageX;
701		}
702		else if (e.clientX != null)
703		{
704			var html = document.documentElement;
705			var body = document.body;
706
707			pageX = e.clientX + (html.scrollLeft || body && body.scrollLeft || 0);
708			pageX -= html.clientLeft || 0;
709		}
710
711		return pageX;
712	};
713
714	SmartFilter.prototype.recountMinPrice = function()
715	{
716		var newMinPrice = (this.priceDiff*this.leftPercent)/100;
717		newMinPrice = (this.minPrice + newMinPrice).toFixed(this.precision);
718
719		if (newMinPrice != this.minPrice)
720			this.minInput.value = newMinPrice;
721		else
722			this.minInput.value = "";
723		/** @global JCSmartFilter smartFilter */
724		smartFilter.keyup(this.minInput);
725	};
726
727	SmartFilter.prototype.recountMaxPrice = function()
728	{
729		var newMaxPrice = (this.priceDiff*this.rightPercent)/100;
730		newMaxPrice = (this.maxPrice - newMaxPrice).toFixed(this.precision);
731
732		if (newMaxPrice != this.maxPrice)
733			this.maxInput.value = newMaxPrice;
734		else
735			this.maxInput.value = "";
736		/** @global JCSmartFilter smartFilter */
737		smartFilter.keyup(this.maxInput);
738	};
739
740	SmartFilter.prototype.onInputChange = function ()
741	{
742		var priceDiff;
743		if (this.minInput.value)
744		{
745			var leftInputValue = this.minInput.value;
746			if (leftInputValue < this.minPrice)
747				leftInputValue = this.minPrice;
748
749			if (leftInputValue > this.maxPrice)
750				leftInputValue = this.maxPrice;
751
752			priceDiff = leftInputValue - this.minPrice;
753			this.leftPercent = (priceDiff*100)/this.priceDiff;
754
755			this.makeLeftSliderMove(false);
756		}
757
758		if (this.maxInput.value)
759		{
760			var rightInputValue = this.maxInput.value;
761			if (rightInputValue < this.minPrice)
762				rightInputValue = this.minPrice;
763
764			if (rightInputValue > this.maxPrice)
765				rightInputValue = this.maxPrice;
766
767			priceDiff = this.maxPrice - rightInputValue;
768			this.rightPercent = (priceDiff*100)/this.priceDiff;
769
770			this.makeRightSliderMove(false);
771		}
772	};
773
774	SmartFilter.prototype.makeLeftSliderMove = function(recountPrice)
775	{
776		recountPrice = (recountPrice !== false);
777
778		this.leftSlider.style.left = this.leftPercent + "%";
779		this.colorUnavailableActive.style.left = this.leftPercent + "%";
780
781		var areBothSlidersMoving = false;
782		if (this.leftPercent + this.rightPercent >= 100)
783		{
784			areBothSlidersMoving = true;
785			this.rightPercent = 100 - this.leftPercent;
786			this.rightSlider.style.right = this.rightPercent + "%";
787			this.colorUnavailableActive.style.right = this.rightPercent + "%";
788		}
789
790		if (this.leftPercent >= this.fltMinPercent && this.leftPercent <= (100-this.fltMaxPercent))
791		{
792			this.colorAvailableActive.style.left = this.leftPercent + "%";
793			if (areBothSlidersMoving)
794			{
795				this.colorAvailableActive.style.right = 100 - this.leftPercent + "%";
796			}
797		}
798		else if(this.leftPercent <= this.fltMinPercent)
799		{
800			this.colorAvailableActive.style.left = this.fltMinPercent + "%";
801			if (areBothSlidersMoving)
802			{
803				this.colorAvailableActive.style.right = 100 - this.fltMinPercent + "%";
804			}
805		}
806		else if(this.leftPercent >= this.fltMaxPercent)
807		{
808			this.colorAvailableActive.style.left = 100-this.fltMaxPercent + "%";
809			if (areBothSlidersMoving)
810			{
811				this.colorAvailableActive.style.right = this.fltMaxPercent + "%";
812			}
813		}
814
815		if (recountPrice)
816		{
817			this.recountMinPrice();
818			if (areBothSlidersMoving)
819				this.recountMaxPrice();
820		}
821	};
822
823	SmartFilter.prototype.countNewLeft = function(event)
824	{
825		var pageX = this.getPageX(event);
826
827		var trackerXCoord = this.getXCoord(this.trackerWrap);
828		var rightEdge = this.trackerWrap.offsetWidth;
829
830		var newLeft = pageX - trackerXCoord;
831
832		if (newLeft < 0)
833			newLeft = 0;
834		else if (newLeft > rightEdge)
835			newLeft = rightEdge;
836
837		return newLeft;
838	};
839
840	SmartFilter.prototype.onMoveLeftSlider = function(e)
841	{
842		if (!this.isTouch)
843		{
844			this.leftSlider.ondragstart = function() {
845				return false;
846			};
847		}
848
849		if (!this.isTouch)
850		{
851			document.onmousemove = BX.proxy(function(event) {
852				this.leftPercent = ((this.countNewLeft(event)*100)/this.trackerWrap.offsetWidth);
853				this.makeLeftSliderMove();
854			}, this);
855
856			document.onmouseup = function() {
857				document.onmousemove = document.onmouseup = null;
858			};
859		}
860		else
861		{
862			document.ontouchmove = BX.proxy(function(event) {
863				this.leftPercent = ((this.countNewLeft(event)*100)/this.trackerWrap.offsetWidth);
864				this.makeLeftSliderMove();
865			}, this);
866
867			document.ontouchend = function() {
868				document.ontouchmove = document.touchend = null;
869			};
870		}
871
872		return false;
873	};
874
875	SmartFilter.prototype.makeRightSliderMove = function(recountPrice)
876	{
877		recountPrice = (recountPrice !== false);
878
879		this.rightSlider.style.right = this.rightPercent + "%";
880		this.colorUnavailableActive.style.right = this.rightPercent + "%";
881
882		var areBothSlidersMoving = false;
883		if (this.leftPercent + this.rightPercent >= 100)
884		{
885			areBothSlidersMoving = true;
886			this.leftPercent = 100 - this.rightPercent;
887			this.leftSlider.style.left = this.leftPercent + "%";
888			this.colorUnavailableActive.style.left = this.leftPercent + "%";
889		}
890
891		if ((100-this.rightPercent) >= this.fltMinPercent && this.rightPercent >= this.fltMaxPercent)
892		{
893			this.colorAvailableActive.style.right = this.rightPercent + "%";
894			if (areBothSlidersMoving)
895			{
896				this.colorAvailableActive.style.left = 100 - this.rightPercent + "%";
897			}
898		}
899		else if(this.rightPercent <= this.fltMaxPercent)
900		{
901			this.colorAvailableActive.style.right = this.fltMaxPercent + "%";
902			if (areBothSlidersMoving)
903			{
904				this.colorAvailableActive.style.left = 100 - this.fltMaxPercent + "%";
905			}
906		}
907		else if((100-this.rightPercent) <= this.fltMinPercent)
908		{
909			this.colorAvailableActive.style.right = 100-this.fltMinPercent + "%";
910			if (areBothSlidersMoving)
911			{
912				this.colorAvailableActive.style.left = this.fltMinPercent + "%";
913			}
914		}
915
916		if (recountPrice)
917		{
918			this.recountMaxPrice();
919			if (areBothSlidersMoving)
920				this.recountMinPrice();
921		}
922	};
923
924	SmartFilter.prototype.onMoveRightSlider = function(e)
925	{
926		if (!this.isTouch)
927		{
928			this.rightSlider.ondragstart = function() {
929				return false;
930			};
931		}
932
933		if (!this.isTouch)
934		{
935			document.onmousemove = BX.proxy(function(event) {
936				this.rightPercent = 100-(((this.countNewLeft(event))*100)/(this.trackerWrap.offsetWidth));
937				this.makeRightSliderMove();
938			}, this);
939
940			document.onmouseup = function() {
941				document.onmousemove = document.onmouseup = null;
942			};
943		}
944		else
945		{
946			document.ontouchmove = BX.proxy(function(event) {
947				this.rightPercent = 100-(((this.countNewLeft(event))*100)/(this.trackerWrap.offsetWidth));
948				this.makeRightSliderMove();
949			}, this);
950
951			document.ontouchend = function() {
952				document.ontouchmove = document.ontouchend = null;
953			};
954		}
955
956		return false;
957	};
958
959	return SmartFilter;
960})();
961/* End */
962;; /* /bitrix/templates/radnext/components/bitrix/catalog/news_raduga_next/bitrix/catalog.smart.filter/catalog/script.js?167809514824055*/

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.