; /* Start:"a:4:{s:4:"full";s:78:"/local/components/dresscode/search/templates/.default/script.js?15611162091057";s:6:"source";s:63:"/local/components/dresscode/search/templates/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ $(function(){ var openSmartFilterFlag = false; var changeSortParams = function(){ window.location.href = $(this).val(); }; var openSmartFilter = function(event){ // smartFilter block adaptive toggle if(!openSmartFilterFlag){ $("#smartFilter").addClass("opened").css('marginTop', ($('.oSmartFilter').offset().top - $('#nextSection').offset().top - $('#nextSection').height() +25)); openSmartFilterFlag = true; } else{ $("#smartFilter").removeClass("opened").removeAttr("style"); openSmartFilterFlag = false; } return event.preventDefault(); }; var closeSmartFilter = function(event){ if(openSmartFilterFlag){ $("#smartFilter").removeClass("opened"); openSmartFilterFlag = false; } }; $(document).on("click", ".oSmartFilter", openSmartFilter); $(document).on("click", "#smartFilter, .oSmartFilter, .rangeSlider", function(event){ return event.stopImmediatePropagation(); }); $("#selectSortParams, #selectCountElements").on("change", changeSortParams); }); /* End */ ; ; /* Start:"a:4:{s:4:"full";s:107:"/bitrix/templates/dresscode/components/dresscode/search.smart.filter/.default/script.min.js?171964375216081";s:6:"source";s:87:"/bitrix/templates/dresscode/components/dresscode/search.smart.filter/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ function JCSmartFilter(t,e,i){this.ajaxURL=t,this.form=null,this.timer=null,this.cacheKey="",this.cache=[],this.viewMode=e,i&&i.SEF_SET_FILTER_URL&&(this.bindUrlToButton("set_filter",i.SEF_SET_FILTER_URL),this.sef=!0),i&&i.SEF_DEL_FILTER_URL&&this.bindUrlToButton("del_filter",i.SEF_DEL_FILTER_URL)}JCSmartFilter.prototype.keyup=function(t){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(BX.delegate(function(){this.reload(t)},this),500)},JCSmartFilter.prototype.click=function(t){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(BX.delegate(function(){this.reload(t)},this),500)},JCSmartFilter.prototype.reload=function(t){if(""!==this.cacheKey)this.timer&&clearTimeout(this.timer),this.timer=setTimeout(BX.delegate(function(){this.reload(t)},this),1e3);else if(this.cacheKey="|",this.position=BX.pos(t,!0),this.form=BX.findParent(t,{tag:"form"}),this.form){var e=[{name:"ajax",value:"y"}];this.gatherInputsValues(e,BX.findChildren(this.form,{tag:new RegExp("^(input|select)$","i")},!0));for(var i=0;ithis.minPrice&&(t=this.curMinPrice-this.minPrice,this.leftPercent=100*t/this.priceDiff,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%"),this.setMinFilteredValue(this.fltMinPrice),this.curMaxPrice=this.minPrice?(t=this.fltMinPrice-this.minPrice,this.fltMinPercent=100*t/this.priceDiff,this.leftPercent>this.fltMinPercent?this.colorAvailableActive.style.left=this.leftPercent+"%":this.colorAvailableActive.style.left=this.fltMinPercent+"%",this.colorAvailableInactive.style.left=this.fltMinPercent+"%"):(this.colorAvailableActive.style.left="0%",this.colorAvailableInactive.style.left="0%")},t.prototype.setMaxFilteredValue=function(t){this.fltMaxPrice=parseFloat(t),this.fltMaxPrice<=this.maxPrice?(t=this.maxPrice-this.fltMaxPrice,this.fltMaxPercent=100*t/this.priceDiff,this.rightPercent>this.fltMaxPercent?this.colorAvailableActive.style.right=this.rightPercent+"%":this.colorAvailableActive.style.right=this.fltMaxPercent+"%",this.colorAvailableInactive.style.right=this.fltMaxPercent+"%"):(this.colorAvailableActive.style.right="0%",this.colorAvailableInactive.style.right="0%")},t.prototype.getXCoord=function(t){var t=t.getBoundingClientRect(),e=document.body,i=document.documentElement,r=window.pageXOffset||i.scrollLeft||e.scrollLeft,i=i.clientLeft||e.clientLeft||0,e=t.left+r-i;return Math.round(e)},t.prototype.getPageX=function(t){t=t||window.event;var e,i,r=null;return this.isTouch&&null!=event.targetTouches[0]?r=t.targetTouches[0].pageX:null!=t.pageX?r=t.pageX:null!=t.clientX&&(e=document.documentElement,i=document.body,r=t.clientX+(e.scrollLeft||i&&i.scrollLeft||0),r-=e.clientLeft||0),r},t.prototype.recountMinPrice=function(){var t=this.priceDiff*this.leftPercent/100;(t=(this.minPrice+t).toFixed(this.precision))!=this.minPrice?this.minInput.value=t:this.minInput.value="",smartFilter.keyup(this.minInput)},t.prototype.recountMaxPrice=function(){var t=this.priceDiff*this.rightPercent/100;(t=(this.maxPrice-t).toFixed(this.precision))!=this.maxPrice?this.maxInput.value=t:this.maxInput.value="",smartFilter.keyup(this.maxInput)},t.prototype.onInputChange=function(){var t,e;this.minInput.value&&(t=(t=(t=(t=this.minInput.value)this.maxPrice?this.maxPrice:t)-this.minPrice,this.leftPercent=100*t/this.priceDiff,this.makeLeftSliderMove(!1)),this.maxInput.value&&((e=(e=this.maxInput.value)this.maxPrice&&(e=this.maxPrice),t=this.maxPrice-e,this.rightPercent=100*t/this.priceDiff,this.makeRightSliderMove(!1))},t.prototype.makeLeftSliderMove=function(t){t=!1!==t,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%";var e=!1;100<=this.leftPercent+this.rightPercent&&(e=!0,this.rightPercent=100-this.leftPercent,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%"),this.leftPercent>=this.fltMinPercent&&this.leftPercent<=100-this.fltMaxPercent?(this.colorAvailableActive.style.left=this.leftPercent+"%",e&&(this.colorAvailableActive.style.right=100-this.leftPercent+"%")):this.leftPercent<=this.fltMinPercent?(this.colorAvailableActive.style.left=this.fltMinPercent+"%",e&&(this.colorAvailableActive.style.right=100-this.fltMinPercent+"%")):this.leftPercent>=this.fltMaxPercent&&(this.colorAvailableActive.style.left=100-this.fltMaxPercent+"%",e)&&(this.colorAvailableActive.style.right=this.fltMaxPercent+"%"),t&&(this.recountMinPrice(),e)&&this.recountMaxPrice()},t.prototype.countNewLeft=function(t){var t=this.getPageX(t),e=this.getXCoord(this.trackerWrap),i=this.trackerWrap.offsetWidth,t=t-e;return t<0?t=0:i=this.fltMinPercent&&this.rightPercent>=this.fltMaxPercent?(this.colorAvailableActive.style.right=this.rightPercent+"%",e&&(this.colorAvailableActive.style.left=100-this.rightPercent+"%")):this.rightPercent<=this.fltMaxPercent?(this.colorAvailableActive.style.right=this.fltMaxPercent+"%",e&&(this.colorAvailableActive.style.left=100-this.fltMaxPercent+"%")):100-this.rightPercent<=this.fltMinPercent&&(this.colorAvailableActive.style.right=100-this.fltMinPercent+"%",e)&&(this.colorAvailableActive.style.left=this.fltMinPercent+"%"),t&&(this.recountMaxPrice(),e)&&this.recountMinPrice()},t.prototype.onMoveRightSlider=function(t){return this.isTouch||(this.rightSlider.ondragstart=function(){return!1}),this.isTouch?(document.ontouchmove=BX.proxy(function(t){this.rightPercent=100-100*this.countNewLeft(t)/this.trackerWrap.offsetWidth,this.makeRightSliderMove()},this),document.ontouchend=function(){document.ontouchmove=document.ontouchend=null}):(document.onmousemove=BX.proxy(function(t){this.rightPercent=100-100*this.countNewLeft(t)/this.trackerWrap.offsetWidth,this.makeRightSliderMove()},this),document.onmouseup=function(){document.onmousemove=document.onmouseup=null}),!1},t}(),JCSmartFilter.prototype.selectDropDownItem=function(t,e){$(t).parent().hasClass("disabled")||this.keyup(BX(e))};var openDropdownList=function(t){$(this).siblings(".dropdownList").toggleClass("opened")},selectItem=function(t){var e=$(this);e.parent().addClass("selected").siblings().removeClass("selected").parent().siblings(".checkedItem").html(e.html()),closeList()},closeList=function(t){$("#smartFilter .dropdownList").removeClass("opened")},showHint=function(t){$(this).find(".hintValue").toggle(),t.stopImmediatePropagation()},closeHint=function(t){$(".hintValue").hide(),t.stopPropagation()},showAllParams=function(t){var e=$(this),i=e.parents("li").siblings("li");0').submit(),t.preventDefault()}),$("#del_filter").on("click",function(t){e.append('').submit(),t.preventDefault()}),i.find(".close").on("click",function(t){$(this).parent().hide(),t.preventDefault()}),$(".propExpander").on("click",function(){$(this).toggleClass("expanded").siblings(".params").toggleClass("collapsed")}),$(".paramsBoxTitle span").on("click",function(){$(this).parents(".paramsBoxTitle").siblings(".propExpander").toggleClass("expanded").siblings(".params").toggleClass("collapsed")}),$(document).on("click","",closeHint),$(document).on("click","",closeList),$(document).on("click","#smartFilter .showALL",showAllParams),$(document).on("click","#smartFilter .hint",showHint),$(document).on("click","#smartFilter .hint .close",closeHint),$(document).on("click","#smartFilter .checkedItem",openDropdownList),$(document).on("click","#smartFilter .dropdown li:not('.disabled') .item",selectItem),$(document).on("click","#smartFilter .hint",function(t){t.stopImmediatePropagation()}),$(document).on("click",".dropdown",function(t){t.stopImmediatePropagation()})}); /* End */ ;; /* /local/components/dresscode/search/templates/.default/script.js?15611162091057*/ ; /* /bitrix/templates/dresscode/components/dresscode/search.smart.filter/.default/script.min.js?171964375216081*/