Your IP : 3.144.21.237


Current Path : /var/www/www-root/data/www/monolith-realty.ru/local/templates/monolitsochi/js/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/local/templates/monolitsochi/js/item-action.min.js

function compareAction(item){const id=item.data("id");$.ajax({url:arAsproOptions.SITE_DIR+"ajax/item.php",type:"POST",dataType:"json",data:$.extend(item.data("item_compare"),{sessid:BX.bitrix_sessid(),action:item.data("action")})}).done((function(data){arAsproOptions.COMPARE_ITEMS=data.items,arAsproOptions.COMPARE_ITEMS.length>0?$(".js-compare-block").addClass("icon-block-with-counter--count"):$(".js-compare-block").removeClass("icon-block-with-counter--count"),$(".js-compare-block .count").text(arAsproOptions.COMPARE_ITEMS.length),BX.util.in_array(id,arAsproOptions.COMPARE_ITEMS)?($(".js-item-action[data-id="+id+"]").addClass("active"),$(".js-item-action[data-id="+id+"]").parent().addClass("active"),$(".js-item-action[data-id="+id+"]").attr("title",$(".js-item-action[data-id="+id+"]").data("title_compared"))):($(".js-item-action[data-id="+id+"]").removeClass("active"),$(".js-item-action[data-id="+id+"]").parent().removeClass("active"),$(".js-item-action[data-id="+id+"]").attr("title",$(".js-item-action[data-id="+id+"]").data("title"))),$(".js-item-action[data-id="+id+"] .info-buttons__item-text").length&&$(".js-item-action[data-id="+id+"] .info-buttons__item-text").text($(".js-item-action[data-id="+id+"]").attr("title"));var eventdata={action:"loadCompare",items:[item[0]]};BX.onCustomEvent("onCompleteAction",[eventdata,arAsproOptions.COMPARE_ITEMS]),BX.onCustomEvent("onNoticeCompare",[eventdata,arAsproOptions.COMPARE_ITEMS])})).fail((function(res){console.error(res)}))}$(document).ready((function(){$(document).on("click",".js-item-action",(function(){const action=$(this).data("action"),_this=$(this);_this.blur(),_this.toggleClass("active"),_this.parent().toggleClass("active"),"function"==typeof window[action+"Action"]&&window[action+"Action"](_this)}))})),BX.addCustomEvent("onNoticeCompare",(function(eventdata,itemsID){try{eventdata&&eventdata.items&&$(eventdata.items[0]).closest(".js-popup-block").find(".side-icons__item--compare").hasClass("active")&&"undefined"!=typeof JNoticeSurface&&JNoticeSurface.get().onAdd2Compare(eventdata.items)}catch(e){console.log(e)}}));
//# sourceMappingURL=item-action.min.js.map