1function ueMegaMenu(){var g_menu,g_menuSection,g_menuItem,g_menuListWrap,g_indicator,g_translateX,g_menuList,g_objBody,g_dataMenuOpen,g_objOverlay,g_menuWrapOffsetLeft,g_viewportWidth,g_dataPositionX,g_dataEditor,g_menuItemTitle,g_showErrors,g_offsetX,g_urlBase;var g_classActive,g_classSection,g_menuActiveClass;var g_isDesktopViewport,g_isNotDesktopViewport,g_isCustomResponsiveViewport,g_isNotCustomResponsiveViewport;var g_arrItems;function setTemplateStyle(){var objLayout=jQuery('.uc-template-wrapper .elementor');var objLayoutClass=objLayout.attr('class');g_menu.addClass(objLayoutClass);} 2function hideIcon(objSection){if(g_indicator.length==0) 3return(false);var objSectionArrow=objSection.find(".sub-arrow");var objSectionTitle=objSection.find('.uc-mega_menu_title');var dataClickable=objSectionTitle.data('clickable-link');if(dataClickable==false) 4return(false);if(dataClickable==true&&g_dataMenuOpen=='click') 5objSectionArrow.hide();} 6function findSections(objSection,menuSectionParent,menuSectionItem){var clonedSectionItem=menuSectionItem.clone();menuSectionParent.html(clonedSectionItem);hideIcon(objSection);var objMenuSection=menuSectionParent.children();objMenuSection.addClass("uc-connected");if(!objMenuSection.hasClass("uc-connected")) 7return(true);objMenuSection.css({'position':'absolute','visibility':'hidden'});} 8function showHideErrors(objSection,menuSectionId,menuSectionParent,menuSectionItem){if(g_showErrors==false) 9return(false);if(menuSectionItem.length>0) 10return(false);objSection.addClass('section-error');menuSectionParent.addClass('section-error');menuSectionParent.html("<div class='uc-section-error'><div class='uc-error'>Couldn't find a section with id: '"+menuSectionId+"'</div></div>");} 11function debugHiddenElements(){if(g_dataEditor=='no') 12return(false);var menuTemplate=jQuery(".uc-template-wrapper");var dataDebug=g_menu.data("debug");if(dataDebug==false) 13return(false);menuTemplate.css({'display':''});} 14function setFullWidth(menuSectionParent){menuSectionParent.css({'width':g_viewportWidth+'px','top':'100%','left':-g_menuWrapOffsetLeft+'px','transform':'translate(0, 0)','right':'unset'});var menuItemParent=menuSectionParent.parents(".uc-mega_menu_list_item");menuItemParent.css({'position':'static'});} 15function setScreenStartPos(menuSectionParent){menuSectionParent.css({'left':-g_menuWrapOffsetLeft+'px','transform':'translate(0, 0)'});} 16function setWidthType(widthType,widthTypeFull,widthTypeCustom,customWidthNumber,menuSectionParent,each){if(widthType==widthTypeFull){setScreenStartPos(menuSectionParent);menuSectionParent.css({'width':g_viewportWidth+'px'});return(false);} 17if(widthType==widthTypeCustom){menuSectionParent.css({'width':customWidthNumber+'px'});} 18if(customWidthNumber=='0'||customWidthNumber==''||customWidthNumber>=g_viewportWidth){setFullWidth(menuSectionParent);}else{g_menuItem.eq(each).css({'position':'relative'});if(g_dataPositionX=="item_left"){menuSectionParent.css({'left':'0'});} 19if(g_dataPositionX=="item_right"){menuSectionParent.css({'left':'unset','right':'0'});} 20if(g_dataPositionX=="item_center"){menuSectionParent.css({'left':'50%','right':'unset'});}}} 21function handleWidthType(){var menuItemsNumber=g_menuItem.length;for(let i=0;i<menuItemsNumber;i++){var menuSectionParent=g_menuItem.eq(i).find('.uc-mega_menu_section');var widthType=g_arrItems[i].dropdown_width;var customWidthNumber=g_arrItems[i].dropdown_width_number;setWidthType(widthType,'full','custom',customWidthNumber,menuSectionParent,i);if(widthType=='default'){var defaultWidthType=g_menuList.data('default-width-type');var defaultWidthNumber=g_menuList.data('default-width-number');setWidthType(defaultWidthType,'default_full','default_custom',defaultWidthNumber,menuSectionParent,i)}}} 22function showHideMenuItemsId(){var debugMenuItemsId=g_menu.data("items-id");if(debugMenuItemsId==false) 23return(false);g_menuListWrap.append("<div class='available_id_s'>Item Id's List<ul class='available_item_id_s_list'></ul></div>");var objItemIdList=g_menu.find(".available_item_id_s_list");var menuItemsNumber=g_menuItem.length;for(let i=0;i<=menuItemsNumber-1;i++){var objMenuItem=g_menuItem.eq(i);var objMenuItemDataId=objMenuItem.data("id");if(!objMenuItemDataId){continue;}else{objItemIdList.append("<li>"+objMenuItemDataId+"</li>");}}} 24function showHideElementsId(){var debugElementsId=g_menu.data("elements-id");if(debugElementsId==false) 25return(false);g_menuListWrap.append("<div class='available_id_s'>Section Id's List<ul class='available_section_id_s_list'></ul></div>");var objSectionIdList=g_menu.find(".available_section_id_s_list");var availableSections=jQuery('section');availableSections.each(function(){var objSectionItem=jQuery(this);var objSectionItemId=objSectionItem.attr('id');var objSectionItemDisplay=objSectionItem.css('display');if(objSectionItemDisplay=='none') 26return(true);if(!objSectionItemId){return(true);} 27if(objSectionItem.hasClass("uc-connected")){return(true);}else{objSectionIdList.append("<li>"+objSectionItemId+"</li>");}});} 28function setOverlayPosition(activeMenuItem){var dataOverlay=g_objOverlay.data('overlay');if(dataOverlay==false) 29return(false);
29if(g_isCustomResponsiveViewport.matches==true||!activeMenuItem.length) 30return(false);var g_menuListWrapOffsetTop=g_menuListWrap.offset().top;var g_menuListWrapOffsetHeight=g_menuListWrap.height();var documentOffsetHeight=jQuery(document).height();var g_objOverlayOffsetTop=g_menuListWrapOffsetTop+g_menuListWrapOffsetHeight;var g_objOverlayOffsetHeight=documentOffsetHeight-g_objOverlayOffsetTop;g_objOverlay.show();g_objOverlay.css({'width':g_viewportWidth+'px','left':-g_menuWrapOffsetLeft+'px','transform':'translate(0, 0)','height':g_objOverlayOffsetHeight+'px'});} 31function setDisactiveResponsiveHeight(){if(g_isNotCustomResponsiveViewport.matches==true) 32return(false);g_menuSection.css({'height':'0px'});} 33function setActiveResponsiveHeight(activeMenuItem){if(!activeMenuItem) 34return(false);var menuSectionActive=activeMenuItem.find(g_classSection);var menuSectionActiveChild=menuSectionActive.children();var menuSectionActiveHeight=menuSectionActiveChild.outerHeight();if(g_menuSection.hasClass(g_classActive)){setDisactiveResponsiveHeight();menuSectionActive.css({'height':menuSectionActiveHeight+'px'});}else{setDisactiveResponsiveHeight();}} 35function setActiveArrow(activeItem){var indicatorActive=activeItem.find('.sub-arrow');var collapseIndicatorClass='.uc_collapse_indicator';var objCollapseIndicator=jQuery(collapseIndicatorClass);if(objCollapseIndicator.length){var objCollapseIndicatorItem=objCollapseIndicator.parents('.uc-mega_menu_list_item');objCollapseIndicatorItem.find('.sub-arrow').html("<span class='uc_expand_indicator'></span>");} 36indicatorActive.html("<span class='uc_collapse_indicator'></span>");} 37function setDisactiveArrow(){var collapseIndicatorClass='.uc_collapse_indicator';var objCollapseIndicator=jQuery(collapseIndicatorClass);if(objCollapseIndicator.length){var objCollapseIndicatorItem=objCollapseIndicator.parents('.uc-mega_menu_list_item');objCollapseIndicatorItem.find('.sub-arrow').html("<span class='uc_expand_indicator'></span>");}} 38function setTopPosition(objElement){var activeMenuSection=objElement.find(g_classSection);var menuListPaddingBottom=g_menuList.css('padding-bottom');activeMenuSection.css({'top':'calc(100% + '+menuListPaddingBottom+')'});} 39function isElementInViewportX(objElement){var activeMenuSection=objElement.find(g_classSection);if(!activeMenuSection.length) 40return(true);var activeMenuSectionWidth=activeMenuSection.width();var elementPositionLeft=activeMenuSection.offset().left;var elementPositionRight=activeMenuSectionWidth+elementPositionLeft;var isInViewport;if(g_dataPositionX=="item_left"){var menuItemPositionLeft=objElement.offset().left;var elementPositionRight=activeMenuSectionWidth+menuItemPositionLeft+g_offsetX;var elementPositionLeft=activeMenuSection.offset().left;if(activeMenuSectionWidth==g_viewportWidth) 41return(true);setTopPosition(objElement);if(elementPositionLeft<0){g_translateX=0+'px';}else if(elementPositionRight>=g_viewportWidth){g_translateX=g_viewportWidth-elementPositionRight+g_offsetX+"px";} 42isInViewport=elementPositionLeft>0&&elementPositionRight<g_viewportWidth;return(isInViewport);} 43if(g_dataPositionX=="item_right"){var menuItemPositionRight=objElement.offset().left+objElement.width();var elementPositionLeft=menuItemPositionRight-activeMenuSectionWidth+g_offsetX;var elementPositionRight=activeMenuSection.offset().left+activeMenuSectionWidth;if(activeMenuSectionWidth==g_viewportWidth) 44return(true);setTopPosition(objElement);if(elementPositionLeft<0){g_translateX=Math.abs(elementPositionLeft)+g_offsetX+"px";}else{g_translateX=0+'px';} 45isInViewport=elementPositionLeft>0&&elementPositionLeft+g_offsetX>0&&elementPositionRight<g_viewportWidth;return(isInViewport);} 46if(g_dataPositionX=="item_center"){var menuItemPositionLeft=objElement.offset().left;var objElementWidth=objElement.width();var elementPositionCenter=menuItemPositionLeft+(objElementWidth/2);var elementPositionLeft=elementPositionCenter-(activeMenuSectionWidth/2)+g_offsetX;var elementPositionRight=elementPositionCenter+(activeMenuSectionWidth/2)+g_offsetX;if(activeMenuSectionWidth==g_viewportWidth) 47return(true);setTopPosition(objElement);if(elementPositionLeft<0){g_translateX='-'+(objElementWidth/2)-menuItemPositionLeft+'px';}else if(elementPositionRight>g_viewportWidth){g_translateX='calc(-50% + '+(g_viewportWidth-elementPositionRight+g_offsetX)+'px)';} 48isInViewport=elementPositionLeft>0&&elementPositionRight<g_viewportWidth;return(isInViewport);}} 49function setCssVisiblePositionX(activeMenuSection){activeMenuSection.css({"transform":"translate("+g_translateX+", 0)"});} 50function setVisiblePositionX(objElement){if(g_isCustomResponsiveViewport.matches==true) 51return(false);var activeMenuSection=objElement.find(g_classSection);var activeMenuSectionWidth=activeMenuSection.width();if(activeMenuSectionWidth>g_viewportWidth) 52return(false);activeMenuSection.css({"transform":"translate("+g_offsetX+"px, 0)"});if(g_dataPositionX=="item_center"&&activeMenuSectionWidth<g_viewportWidth){activeMenuSection.css({"transform":"translate(calc(-50% + "+g_offsetX+"px), 0)"});} 53if(isElementInViewportX(objElement)) 54return(false);setCssVisiblePositionX(activeMenuSection);} 55function setCoverPosition(menuSection,menuSectionChild){if(menuSection.length==0) 56return(false);
56if(menuSectionChild.length==0) 57return(false);var objCover=menuSection.next();var menuItem=menuSectionChild.parents('.uc-mega_menu_list_item');var objCoverHeight=menuSectionChild.outerHeight();var objCoverWidth=menuSection.width();var menuItemWidth=menuItem.width();var menuItemOffsetLeft=menuItem.offset().left;var menuSectionOffsetLeft=menuSection.offset().left;var menuItemOffsetRight=menuItemOffsetLeft+menuItemWidth;var menuSectionOffsetRight=menuSectionOffsetLeft+objCoverWidth;objCover.css({'width':objCoverWidth+'px','height':objCoverHeight+'px'});if(menuItemOffsetLeft==menuSectionOffsetLeft){objCover.css({'left':'0px','right':'unset'});} 58if(menuItemOffsetRight==menuSectionOffsetRight){objCover.css({'left':'unset','right':'0px'});} 59if(menuItemOffsetLeft>menuSectionOffsetLeft){var menuItemSectionPositionDeviation=menuItemOffsetLeft-menuSectionOffsetLeft;objCover.css({'right':'unset','left':-menuItemSectionPositionDeviation+'px'});} 60if(menuItemOffsetLeft<menuSectionOffsetLeft){var menuItemSectionPositionDeviation=menuSectionOffsetLeft-menuItemOffsetLeft;objCover.css({'right':'unset','left':menuItemSectionPositionDeviation+'px'});} 61if(objCoverWidth==g_viewportWidth){objCover.css({'right':'unset','left':-g_menuWrapOffsetLeft+'px'});}} 62function setActive(activeMenuItem){g_menuItem.removeClass(g_classActive);g_menuSection.removeClass(g_classActive);var activeMenuItemSection=activeMenuItem.find(g_classSection);activeMenuItem.addClass(g_classActive);activeMenuItemSection.addClass(g_classActive);activeMenuItemSection.children().css({'position':'','visibility':'visible'});if(activeMenuItemSection.children().length){g_menu.addClass(g_menuActiveClass);}else{g_menu.removeClass(g_menuActiveClass);} 63if(g_isCustomResponsiveViewport.matches==true){setActiveResponsiveHeight(activeMenuItem);} 64setVisiblePositionX(activeMenuItem);handleWidthType();setTipPosition(activeMenuItemSection);setOverlayPosition(activeMenuItem);var menuSectionChild=activeMenuItemSection.children();setCoverPosition(activeMenuItemSection,menuSectionChild);scrollToHead(activeMenuItem);} 65function setDisactive(){g_menuItem.removeClass(g_classActive);g_menuSection.removeClass(g_classActive);setDisactiveArrow();g_menuSection.children().css({'position':'absolute','visibility':'hidden'});g_menu.removeClass(g_menuActiveClass);if(g_objOverlay.length) 66g_objOverlay.hide();} 67function createTip(menuSectionParent){var isTipExist=menuSectionParent.data('tip');if(isTipExist==false) 68return(false);var offsetY=g_menuList.data("offset-y");if(offsetY<14){menuSectionParent.css({'padding-top':'14px'})}else if(offsetY>=14){menuSectionParent.css({'padding-top':offsetY+'px'})} 69var objsection=menuSectionParent.find('.uc-connected');objsection.prepend('<div class="ue-tip"></div>');var objErrorTip;if(menuSectionParent.hasClass('section-error')){menuSectionParent.find('.uc-section-error').prepend('<div class="ue-tip"></div>');objErrorTip=menuSectionParent.find('.ue-tip');objErrorTip.css({'border-top-color':'#cccccc','border-left-color':'#cccccc'})} 70var objTip=menuSectionParent.find('.ue-tip');var menuSectionBgColor=objsection.css('background-color');var dataTipBgColor=menuSectionParent.data('bg-color');var dataTipMainColor=menuSectionParent.data('tip-color');var isMenuSectionBorderExist=parseInt(objsection.css('border-width'))>0;var menuSectionBorderColor=objsection.css('border-color');if(menuSectionBgColor=='rgba(0, 0, 0, 0)'&&isMenuSectionBorderExist==false){objTip.css({'border-top-color':dataTipBgColor,'border-left-color':dataTipBgColor,});} 71if(isMenuSectionBorderExist==true){objTip.css({'border-top-color':menuSectionBorderColor,'border-left-color':menuSectionBorderColor,});} 72if(menuSectionBgColor!='rgba(0, 0, 0, 0)'&&isMenuSectionBorderExist==false){objTip.css({'border-top-color':menuSectionBgColor,'border-left-color':menuSectionBgColor,});} 73if(menuSectionParent.hasClass('section-error')){objErrorTip.css({'border-top-color':'#cccccc','border-left-color':'#cccccc'})} 74if(dataTipMainColor!=''){objTip.css({'border-top-color':dataTipMainColor,'border-left-color':dataTipMainColor,});} 75if(menuSectionBgColor=='rgba(0, 0, 0, 0)'&&isMenuSectionBorderExist==false&&dataTipBgColor==''&&dataTipMainColor==''){objTip.css({'border-top-color':'#C9C9C9','border-left-color':'#C9C9C9'});}} 76function setTipPosition(menuSectionParent){if(menuSectionParent.length==0) 77return(false);var objTip=menuSectionParent.find('.ue-tip');var objsection=menuSectionParent.find('.uc-connected');var menuSectionBgColor=objsection.css('background-color');var menuSectionBorderColor=objsection.css('border-color');var dataTipBgColor=menuSectionParent.data('bg-color');var dataTipMainColor=menuSectionParent.data('tip-color');var isMenuSectionBorderExist=parseInt(objsection.css('border-width'))>0;var menuItem=menuSectionParent.parents('.uc-mega_menu_list_item');var menuItemWidth=menuItem.width();var objTipWidth=objTip.width();var menuSectionWidth=menuSectionParent.width();var menuItemCenter=menuItemWidth/2;var menuItemOffsetLeft=menuItem.offset().left;var menuSectionOffsetLeft=menuSectionParent.offset().left;var menuItemOffsetRight=menuItemOffsetLeft+menuItemWidth;var menuSectionOffsetRight=menuSectionOffsetLeft+menuSectionWidth;var menuItemCenterOffsetLeft=menuItemOffsetLeft+menuItemCenter;if(menuItemOffsetLeft==menuSectionOffsetLeft){objTip.css({'left':(menuItemWidth/2)+'px','right':'unset'});} 78if(menuItemOffsetRight==menuSectionOffsetRight){objTip.css({'left':'unset','right':(menuItemWidth/2)+'px'});} 79if(menuSectionOffsetLeft<menuItemOffsetLeft&&menuSectionOffsetRight>menuItemCenterOffsetLeft+objTipWidth){var menuItemSectionPositionDeviation=menuItemOffsetLeft-menuSectionOffsetLeft;objTip.css({'left':menuItemSectionPositionDeviation+(menuItemWidth/2)+'px','right':'unset'});} 80if(menuSectionOffsetLeft<menuItemOffsetLeft&&menuSectionOffsetRight<=menuItemCenterOffsetLeft+objTipWidth){var menuItemSectionPositionDeviation=menuItemOffsetLeft-menuSectionOffsetLeft;objTip.css({'left':'unset','right':'0px','transform':'translate(0, -50%) rotate(0)','border-top-color':'transparent','border-left-color':'transparent'});if(menuSectionBgColor=='rgba(0, 0, 0, 0)'&&isMenuSectionBorderExist==false){objTip.css({'border-right-color':dataTipBgColor});} 81if(isMenuSectionBorderExist==true){objTip.css({'border-right-color':menuSectionBorderColor});} 82if(menuSectionBgColor!='rgba(0, 0, 0, 0)'&&isMenuSectionBorderExist==false){objTip.css({'border-right-color':menuSectionBgColor});} 83if(menuSectionParent.hasClass('section-error')){var objErrorTip=menuSectionParent.find('.ue-tip');objErrorTip.css({'border-right-color':'#cccccc',});} 84if(dataTipMainColor!=''){objTip.css({'border-right-color':dataTipMainColor});} 85if(menuSectionBgColor=='rgba(0, 0, 0, 0)'&&isMenuSectionBorderExist==false&&dataTipBgColor==''&&dataTipMainColor==''){objTip.css({'border-right-color':'#C9C9C9'});}} 86if(menuSectionOffsetLeft>menuItemOffsetLeft&&menuSectionOffsetLeft<menuItemCenterOffsetLeft-objTipWidth){var menuItemSectionPositionDeviation=menuSectionOffsetLeft-menuItemOffsetLeft;objTip.css({'left':(menuItemWidth/2)-menuItemSectionPositionDeviation+'px','right':'unset'});} 87if(menuSectionOffsetLeft>menuItemOffsetLeft&&menuSectionOffsetLeft>=menuItemCenterOffsetLeft-objTipWidth){var menuItemSectionPositionDeviation=menuSectionOffsetLeft-menuItemOffsetLeft;objTip.css({'left':'0px','right':'unset','transform':'translate(0, -50%) rotate(0)','border-top-color':'transparent'});}} 88function getScrollPos(){if(g_isNotCustomResponsiveViewport.matches==true) 89return(false);g_menuItem.each(function(){var objItem=jQuery(this);var menuItemOffsetTop=objItem.offset().top;objItem.attr('data-scrollpos',menuItemOffsetTop);});} 90function isElementInViewport(element){var elementTop=element.offset().top;var viewportTop=jQuery(window).scrollTop();var isInViewport=elementTop>viewportTop;return(isInViewport);} 91function scrollToHead(menuItem){if(g_isNotCustomResponsiveViewport.matches==true) 92return(false);var menuItemOffsetTop=menuItem.data('scrollpos');var menuItemSection=menuItem.find(g_classSection);setTimeout(function(){if(isElementInViewport(menuItemSection)==true) 93return(false);g_menuListWrap.animate({scrollTop:menuItemOffsetTop},400);},400);} 94function showHideArrows(){if(g_indicator.length==0) 95return(false);var dataAnimation=g_indicator.data('animate-arrows') 96if(dataAnimation==false) 97return(false);setTimeout(function(){g_indicator.css({'opacity':1});},300)} 98function checkUrl(){var itemsNumber=g_menuItem.length;for(let i=0;i<itemsNumber;i++){var menuItemTitle=g_menuItem.eq(i).find('.uc-mega_menu_title');var menuItemUrl=menuItemTitle.attr('href');if(menuItemUrl==g_urlBase){menuItemTitle.addClass('uc-current-page');}}} 99function hideSectionInEditor(menuSectionItem){if(g_dataEditor==false) 100return(false);
100if(menuSectionItem.hasClass('uc-connected')==true) 101return(false);var dataShowInEditor=g_menuList.data('show-section');if(dataShowInEditor=='no'){menuSectionItem.css({'position':'','visibility':'visible'});} 102if(dataShowInEditor=='message'||dataShowInEditor=='hide'){menuSectionItem.css({'position':'absolute','visibility':'hidden'});}} 103function openFirstItem(){if(g_isNotCustomResponsiveViewport.matches==true) 104return(false);var firstItem=g_menuItem.eq(0);var firsItemTitle=firstItem.find('.uc-mega_menu_title');var dataFirstItemType=firsItemTitle.data('type');var dataFirstItemClickable=firsItemTitle.data('clickable-link');if(dataFirstItemType!='section') 105return(false);if(dataFirstItemClickable!=false) 106return(false);var dataOpenFirstItem=g_menuList.data('open-first');if(dataOpenFirstItem==false) 107return(false);setActive(firstItem);setActiveArrow(firstItem);} 108function handleItemTypeSection(){var menuSectionParentItem=g_menuSection.parents('.uc-mega_menu_list_item');menuSectionParentItem.each(function(){var objSection=jQuery(this);var menuSectionId=objSection.data("id");var menuSectionItem=jQuery("#"+menuSectionId);var menuSectionParent=objSection.find(g_classSection);setTemplateStyle();findSections(objSection,menuSectionParent,menuSectionItem);showHideErrors(objSection,menuSectionId,menuSectionParent,menuSectionItem);debugHiddenElements();hideSectionInEditor(menuSectionItem)});handleWidthType();showHideArrows();for(let i=0;i<g_menuItem.length;i++){var objMenuItem=g_menuItem.eq(i);var menuSection=objMenuItem.find(g_classSection);var menuSectionChild=menuSection.children();setVisiblePositionX(objMenuItem);createTip(menuSection);setTipPosition(menuSection);setCoverPosition(menuSection,menuSectionChild);} 109showHideMenuItemsId();showHideElementsId();if(g_isCustomResponsiveViewport.matches==true){g_menuListWrap.addClass('uc-mobile-mode');}else{g_menuListWrap.removeClass('uc-mobile-mode');} 110getScrollPos();checkUrl();openFirstItem();} 111function menuItemClick(objTitle){var activeMenuItemClick=objTitle.parents('.uc-mega_menu_list_item');if(activeMenuItemClick.hasClass(g_classActive)){setDisactive();if(g_isCustomResponsiveViewport.matches==true) 112setDisactiveResponsiveHeight();}else{setActive(activeMenuItemClick);setActiveArrow(activeMenuItemClick);}} 113function onMenuItemClick(){var objTitle=jQuery(this);var isItemClickable=objTitle.data('clickable-link');if(g_dataMenuOpen=='hover'){var itemType=objTitle.data('type');if(g_isDesktopViewport.matches==true&&g_isCustomResponsiveViewport.matches==false&&itemType!='link'&&isItemClickable==false) 114return(false);if(itemType!='link'&&isItemClickable==false){menuItemClick(objTitle);return(false);} 115if(g_isNotDesktopViewport.matches==true&&isItemClickable==true){menuItemClick(objTitle);return(false);} 116if(g_isDesktopViewport.matches==true&&isItemClickable==true) 117return(true);menuItemClick(objTitle);} 118if(g_isDesktopViewport.matches==true&&isItemClickable==true) 119return(true);if(isItemClickable==false) 120menuItemClick(objTitle);} 121function setDisactiveOnbodyClick(event){if(g_menuItem.hasClass(g_classActive)==false) 122return(false);if(g_isCustomResponsiveViewport.matches==true) 123return(false);if(jQuery(event.target).hasClass('uc_expand_indicator')) 124return(false);if(!jQuery(event.target).closest(g_menuItem).length) 125setDisactive();} 126function bodyClick(event){if(g_dataMenuOpen=='hover'){if(g_isDesktopViewport.matches==true&&g_isNotCustomResponsiveViewport.matches==true){return(false);} 127setDisactiveOnbodyClick(event);} 128setDisactiveOnbodyClick(event);} 129function onInnerLinkClick(){setDisactive();if(g_isCustomResponsiveViewport.matches==true){setDisactiveResponsiveHeight();g_menuListWrap.removeClass(g_menuActiveClass);g_objBody.removeClass(g_menuActiveClass);g_menu.removeClass(g_menuActiveClass);} 130openFirstItem();} 131function handleMenuItemClick(){g_menuItemTitle.on("click",onMenuItemClick);jQuery(document).on('click',function(event){bodyClick(event);});} 132function onMenuItemMouseEnter(){if(g_dataMenuOpen=='click') 133return(false);if(g_isNotDesktopViewport.matches==true||g_isCustomResponsiveViewport.matches==true) 134return(false);var activeMenuItemHover=jQuery(this);setActive(activeMenuItemHover);setActiveArrow(activeMenuItemHover);} 135function onMenuItemMouseLeave(){if(g_dataMenuOpen=='click') 136return(false);
136if(g_isNotDesktopViewport.matches==true||g_isCustomResponsiveViewport.matches==true) 137return(false);setDisactive();} 138function handleMenuItemHover(){g_menuItem.on('mouseenter',onMenuItemMouseEnter);g_menuListWrap.on('mouseleave',onMenuItemMouseLeave);} 139function handleMenuInnerLinksClick(){g_menuList.on('close_mega_menu',onInnerLinkClick);} 140function menuItemOpen(){handleMenuItemHover();handleMenuItemClick();handleMenuInnerLinksClick();} 141function onBurgerMenuClick(){g_menuListWrap.addClass(g_menuActiveClass);g_objBody.addClass(g_menuActiveClass);} 142function onCloseBurgerMenuBtnClick(){g_menuItem.removeClass(g_classActive);g_menuSection.removeClass(g_classActive);setDisactiveArrow();setDisactiveResponsiveHeight();g_menuListWrap.removeClass(g_menuActiveClass);g_objBody.removeClass(g_menuActiveClass);g_menu.removeClass(g_menuActiveClass);openFirstItem();} 143function removeOpenClass(){if(g_menuListWrap.hasClass(g_menuActiveClass)==false) 144return(false);if(g_objBody.hasClass(g_menuActiveClass)==false) 145return(false);g_menuListWrap.removeClass(g_menuActiveClass);g_objBody.removeClass(g_menuActiveClass);} 146function onWindowResize(){var activeMenuItem=g_menu.find('.uc-mega_menu_list_item.uc-active_item');if(g_isCustomResponsiveViewport.matches==true){g_menuListWrap.addClass('uc-mobile-mode');setActiveResponsiveHeight(activeMenuItem);g_objOverlay.hide();} 147if(g_isNotCustomResponsiveViewport.matches==true){removeOpenClass();g_menuListWrap.removeClass('uc-mobile-mode');g_menuSection.css({'height':'unset'});} 148g_viewportWidth=jQuery(window).width();g_menuWrapOffsetLeft=g_menuListWrap.offset().left;handleWidthType();for(let i=0;i<g_menuItem.length;i++){var objMenuItem=g_menuItem.eq(i);var menuSection=objMenuItem.find(g_classSection);var menuSectionChild=menuSection.children();setVisiblePositionX(objMenuItem);setTipPosition(menuSection);setCoverPosition(menuSection,menuSectionChild);} 149setOverlayPosition(activeMenuItem);getScrollPos();} 150this.init=function(objMegaMenu,arrItems,urlAjax){g_menu=jQuery(objMegaMenu);g_menuSection=g_menu.find(".uc-mega_menu_section");g_menuList=g_menu.find(".uc-mega_menu_list");g_menuItem=g_menu.find(".uc-mega_menu_list_item");g_menuItemTitle=g_menu.find(".uc-mega_menu_title");g_menuListWrap=g_menu.find(".uc-mega_menu-wrapper");g_indicator=g_menuItem.find('.sub-arrow');g_objBody=jQuery("body");g_dataMenuOpen=g_menuList.data("menu-open");g_objOverlay=g_menu.find('.uc_mega_menu_overlay');g_menuWrapOffsetLeft=g_menuListWrap.offset().left;g_viewportWidth=jQuery(window).width();g_dataPositionX=g_menuList.data("position-x");g_dataEditor=g_menu.data("editor");g_showErrors=g_menu.data("errors");g_offsetX=g_menuList.data("offset-x");g_urlBase=urlAjax;g_menuActiveClass="uc-menu-open";g_classSection='.uc-mega_menu_section';g_classActive='uc-active_item';g_isDesktopViewport=window.matchMedia("(min-width: 1025px)");g_isNotDesktopViewport=window.matchMedia("(max-width: 1024px)");var customResponsiveBreakpoint=g_menuListWrap.data("responsive-breakpoint");g_isCustomResponsiveViewport=window.matchMedia("(max-width: "+customResponsiveBreakpoint+"px)");g_isNotCustomResponsiveViewport=window.matchMedia("(min-width: "+(customResponsiveBreakpoint+1)+"px)");g_arrItems=arrItems;handleItemTypeSection();var burgerMenu=g_menu.find(".uc-mega_menu-burger");var closeBtn=g_menu.find(".uc-mega_menu-close-btn");burgerMenu.on("click",onBurgerMenuClick);closeBtn.on("click",onCloseBurgerMenuBtnClick);var showMenuInEditor=g_menu.data('show-menu');if(showMenuInEditor==false&&g_dataEditor=='yes') 151return(false);menuItemOpen();jQuery(window).on('resize',onWindowResize);}}
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.