Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/local/templates/monolitsochi/js/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/local/templates/monolitsochi/js/speed.min.js |
var funcDefined=function(func){try{return"function"==typeof func||"function"==typeof window[func]}catch(e){return!1}};CheckTopMenuPadding=function(){if($(".logo_and_menu-row .right-icons .wrap_icon").length&&$(".logo_and_menu-row .menu-row").length&&!$(".subbottom.menu-row").length){var menuPosition=$(".menu-row .menu-only").position().left,leftPadding=0,rightPadding=0;$(".logo_and_menu-row .menu-row>div").each((function(indx){if(!$(this).hasClass("menu-only")){var elementPosition=$(this).position().left,elementWidth=$(this).outerWidth()+1;elementPosition>menuPosition?rightPadding+=elementWidth:leftPadding+=elementWidth}})).promise().done((function(){$(".logo_and_menu-row .menu-only").css({"padding-left":leftPadding,"padding-right":rightPadding})}))}},CheckTopMenuOncePadding=function(){if($(".menu-row.sliced .right-icons .wrap_icon").length){var menuPosition=$(".menu-row .menu-only").position().left,leftPadding=0,rightPadding=0;$(".menu-row.sliced .maxwidth-theme>div>div>div").each((function(indx){if(!$(this).hasClass("menu-only")){var elementPosition=$(this).position().left,elementWidth=$(this).outerWidth()+1;elementPosition>menuPosition?rightPadding+=elementWidth:leftPadding+=elementWidth}})).promise().done((function(){$(".menu-row.sliced .menu-only").css({"padding-left":leftPadding,"padding-right":rightPadding})}))}else if($(".logo_and_menu-row .mega-menu.sliced").length&&!$(".subbottom.menu-row").length){var leftPadding=0;$(".logo_and_menu-row .maxwidth-theme>div>div>div").each((function(indx){if(!$(this).hasClass("menu-row")){var elementPosition=$(this).position().left,elementWidth=$(this).outerWidth()+1;$(this).is(":visible")&&!$(this).hasClass("pull-right")&&$(this).height()||(elementWidth=0),leftPadding+=elementWidth}})).promise().done((function(){$(".logo_and_menu-row .logo-row .menu-row").css({"padding-left":leftPadding})}))}},CheckTopMenuDotted=function(){var menu=$("nav.mega-menu.sliced");if(!window.matchMedia("(max-width:991px)").matches)return menu.length&&menu.each((function(){var menuMoreItem=$(this).find(".header-menu__item--more-items");if("none"==$(this).parents(".collapse").css("display"))return!1;var headerFixedBlock=$(this).parents("#headerfixed");if(headerFixedBlock.length&&!headerFixedBlock.hasClass("fixed"))return!1;var block=$(this).closest(".header-menu"),block_w=block.outerWidth(),items=$(this).find(".header-menu__wrapper > .header-menu__item"),menu_w=0;items.each((function(i,el){var _el=$(el);menu_w+=_el.outerWidth(!0)}));var afterHide=!1,newItemsArr=[];for(menuItemNewSave="";menu_w>block_w-1&&(menuItemOldSave=$(this).find(".header-menu__wrapper > .header-menu__item").not(".header-menu__item--more-items").last(),menuItemOldSave.length);){var classes=menuItemOldSave.attr("class"),newMenuItem=$("<li />").addClass(classes).attr("data-hidewidth",menu_w).html(menuItemOldSave.html());newItemsArr.push(newMenuItem),menuItemOldSave.remove(),menuMoreItem.css({display:"flex",opacity:1}),menu_w=0,items.each((function(i,el){var _el=$(el);menu_w+=_el.outerWidth(!0)})),block_w=block.outerWidth(),afterHide=!0}if(newItemsArr=newItemsArr.reverse(),menuMoreItem.find("> .header-menu__dropdown-menu").prepend(newItemsArr),!afterHide){var moreItemsArr=[];do{if(menuItemOldSave=menuMoreItem.find("> .header-menu__dropdown-menu > li").first(),!menuItemOldSave.length){menuMoreItem.hide();break}var hideWidth;if(menuItemOldSave.attr("data-hidewidth")>block_w)break;menuItemOldSave.removeClass("scroll-inited");var classes=menuItemOldSave.attr("class"),moreMenuItem=$("<div />").addClass(classes).html(menuItemOldSave.html());if(menuItemOldSave.remove(),$(moreMenuItem).insertBefore(menuMoreItem),!menuItemOldSave.length){menuMoreItem.hide();break}menu_w=0,items.each((function(i,el){var _el=$(el);menu_w+=_el.outerWidth()}))}while(menu_w<=block_w)}menu.closest(".header-menu").addClass("dotted-complete");var wrapper=$(this).closest(".hide-dotted");wrapper.length&&wrapper.addClass("dotted-complete")})),!1},funcDefined("InitTopestMenuGummi")||(InitTopestMenuGummi=function(){if(!window.isOnceInited){function _init(){var arItems=$menuTopest.find(">li:not(.more)"),cntItems=arItems.length;if(cntItems)for(var itemsWidth=0,i=0;i<cntItems;++i){var item,itemWidth=arItems.eq(i).actual("outerWidth",{includeMargin:!0});arItemsHideWidth[i]=(itemsWidth+=itemWidth)+(i!==cntItems-1?moreWidth:0)}}function _gummi(){var rowWidth=$menuTopest.actual("innerWidth"),arItems=$menuTopest.find(">li:not(.more),li.more>.dropdown>li"),cntItems=arItems.length;if(cntItems){for(var bMore=!1,i=cntItems-1;i>=0;--i){var item,bInMore,clone;if(!(bInMore=(item=arItems.eq(i)).parents(".more").length>0))if(arItemsHideWidth[i]>rowWidth)bMore||(bMore=!0,more.removeClass("hidden")),(clone=item.clone()).find(">a").addClass("dark_font"),clone.prependTo(moreDropdown),item.addClass("hidden cloned"),rowWidth=$menuTopest.actual("innerWidth")}for(var i=0;i<cntItems;++i){var item,bInMore,clone;if(bInMore=(item=arItems.eq(i)).parents(".more").length>0)if(arItemsHideWidth[i]<=rowWidth)i===cntItems-1&&(bMore=!1,more.addClass("hidden")),(clone=item.clone()).find(">a").removeClass("dark_font"),clone.insertBefore(more),item.addClass("cloned")}$menuTopest.find("li.cloned").remove()}}var $menuTopest=$(".menu.topest");if($menuTopest.length)try{var more=$menuTopest.find(">.more"),moreDropdown=more.find(">.dropdown"),moreWidth=more.actual("outerWidth",{includeMargin:!0}),arItemsHideWidth=[];ignoreResize.push(!0),_init(),_gummi(),ignoreResize.pop(),BX.addCustomEvent("onWindowResize",(function(eventdata){try{ignoreResize.push(!0),_gummi(),$menuTopest.addClass("initied"),$menuTopest.parent().addClass("initied")}catch(e){}finally{ignoreResize.pop()}}))}catch(e){}}}),funcDefined("InitTopMenuGummi")||(InitTopMenuGummi=function(){function _init(){var arItems=$topMenu.closest(".wrap_menu").find(".inc_menu .menu_top_block >li:not(.more)"),cntItems=arItems.length;if(cntItems)for(var itemsWidth=0,i=0;i<cntItems;++i){var item,itemWidth=arItems.eq(i).actual("outerWidth");arItemsHideWidth[i]=(itemsWidth+=itemWidth)+(i!==cntItems-1?moreWidth:0)}}function _gummi(){var rowWidth=$wrapMenu.actual("innerWidth")-$wrapMenuLeft.actual("innerWidth"),arItems=$topMenu.find(">li:not(.more):not(.catalog),li.more>.dropdown>li"),cntItems=arItems.length;if(cntItems){for(var bMore=!1,i=cntItems-1;i>=0;--i){var item,bInMore,clone;if(!(bInMore=(item=arItems.eq(i)).parents(".more").length>0))if(arItemsHideWidth[i]>rowWidth)bMore||(bMore=!0,more.removeClass("hidden")),(clone=item.clone()).find(">.dropdown").removeAttr("style").removeClass("toleft"),clone.find(">a").addClass("dark_font").removeAttr("style"),clone.prependTo(moreDropdown),item.addClass("cloned")}for(var i=0;i<cntItems;++i){var item,bInMore,clone;if(bInMore=(item=arItems.eq(i)).parents(".more").length>0)if(arItemsHideWidth[i]<=rowWidth)i===cntItems-1&&(bMore=!1,more.addClass("hidden")),(clone=item.clone()).find(">a").removeClass("dark_font"),clone.insertBefore(more),item.addClass("cloned")}$topMenu.find("li.cloned").remove();var cntItemsVisible=$topMenu.find(">li:not(.more):not(.catalog)").length,o=rowWidth-arItemsHideWidth[cntItemsVisible-1],itemsPaddingAdd=Math.floor(o/(cntItemsVisible+(more.hasClass("hidden")?0:1))),itemsPadding_new=itemsPadding_min+itemsPaddingAdd,itemsPadding_new_l=Math.floor(itemsPadding_new/2),itemsPadding_new_r=itemsPadding_new-itemsPadding_new_l;$topMenu.find(">li:not(.catalog):visible>a").each((function(){$(this).css({"padding-left":itemsPadding_new_l+"px"}),$(this).css({"padding-right":itemsPadding_new_r+"px"})}));var lastItemPadding_new=itemsPadding_new+o-(cntItemsVisible+(more.is(":visible")?1:0))*itemsPaddingAdd,lastItemPadding_new_l=Math.floor(lastItemPadding_new/2),lastItemPadding_new_r=lastItemPadding_new-lastItemPadding_new_l;$topMenu.find(">li:visible").last().find(">a").css({"padding-left":lastItemPadding_new_l+"px"}),$topMenu.find(">li:visible").last().find(">a").css({"padding-right":lastItemPadding_new_r+"px"})}}var $topMenu=$(".menu_top_block");if($menuTopest.length){var $wrapMenu=$topMenu.parents(".wrap_menu"),$wrapMenuLeft=$wrapMenu.find(".catalog_menu_ext"),more=$topMenu.find(">.more"),moreWidth=more.actual("outerWidth",{includeMargin:!0});more.addClass("hidden");var arItemsHideWidth=[],moreDropdown=more.find(">.dropdown"),itemsPadding,itemsPadding_min=2*parseInt(more.find(">a").css("padding-left"));setTimeout((function(){ignoreResize.push(!0),_init(),_gummi(),ignoreResize.pop()}),5e3),BX.addCustomEvent("onWindowResize",(function(eventdata){try{ignoreResize.push(!0),_gummi()}catch(e){}finally{ignoreResize.pop()}}))}}); //# sourceMappingURL=speed.min.js.map