1( function( $, elementor ) { 2 3 "use strict"; 4 5 var JetMenuWidget = { 6 7 init: function() { 8 9 var widgets = { 10 'jet-mega-menu.default' : JetMenuWidget.widgetMegaMenu, 11 'jet-custom-menu.default' : JetMenuWidget.widgetCustomMenu, 12 'jet-mobile-menu.default' : JetMenuWidget.widgetMobileMenu, 13 }; 14 15 $.each( widgets, function( widget, callback ) { 16 elementor.hooks.addAction( 'frontend/element_ready/' + widget, callback ); 17 } ); 18 19 }, 20 21 widgetMegaMenu: function( $scope ) { 22 let $megaMenu = $scope.find( '.jet-mega-menu--location-elementor' ), 23 $mobileMenu = $scope.find( '.jet-mobile-menu' ); 24 25 if ( $megaMenu[0] ) { 26 let settings = $megaMenu.data( 'settings' ); 27 28 $megaMenu.JetMegaMenu( { 29 menuId: settings.menuId, 30 menuUniqId: settings.menuUniqId, 31 rollUp: settings.rollUp, 32 layout: settings.layout, 33 subEvent: settings.subEvent, 34 subTrigger: settings.subTrigger, 35 breakpoint: settings.breakpoint, 36 megaWidthType: settings.megaWidthType, 37 megaWidthSelector: settings.megaWidthSelector, 38 megaAjaxLoad: settings.megaAjaxLoad, 39 classes: { 40 instance: 'jet-mega-menu', 41 menuContainer: 'jet-mega-menu-container', 42 menuList: 'jet-mega-menu-list', 43 menuItem: 'jet-mega-menu-item', 44 menuItemLink: 'jet-mega-menu-item__link', 45 subMenuContainer: 'jet-mega-menu-sub-menu', 46 subMenuList: 'jet-mega-menu-sub-menu__list', 47 megaContainer: 'jet-mega-menu-mega-container', 48 } 49 } ); 50 } 51 52 if ( $mobileMenu[0] ) { 53 let menuInstanceId = $mobileMenu.attr( 'id' ), 54 menuId = $mobileMenu.data( 'menu-id' ) || false, 55 menuOptions = $mobileMenu.data( 'menu-options' ) || {}; 56 57 window.jetMenu.createMobileRenderInstance( menuInstanceId, menuId, menuOptions ); 58 } 59 }, 60 61 widgetCustomMenu: function( $scope ) { 62 var $target = $scope.find( '.jet-custom-nav' ), 63 instance = null, 64 menuItem = null; 65 66 if ( ! $target.length ) { 67 return; 68 } 69 70 if ( JetMenuWidget.mobileAndTabletcheck() ) { 71 $scope.on( 'touchstart', '.jet-custom-nav__item > a, .jet-custom-nav__item > a .jet-dropdown-arrow', touchStartItem ); 72 $scope.on( 'touchend', '.jet-custom-nav__item > a, .jet-custom-nav__item > a .jet-dropdown-arrow', touchEndItem ); 73 } else { 74 $scope.on( 'mouseenter mouseover', '.jet-custom-nav__item', mouseEnterHandler ); 75 $scope.on( 'mouseleave', '.jet-custom-nav__item', mouseLeaveHandler ); 76 } 77 78 function mouseEnterHandler( event ) { 79 menuItem = $( event.target ).parents( '.jet-custom-nav__item' ); 80 menuItem.addClass( 'hover-state' ); 81 } 82 83 function mouseLeaveHandler( event ) { 84 menuItem = $( event.target ).parents( '.jet-custom-nav__item' ); 85 menuItem.removeClass( 'hover-state' ); 86 } 87 88 function touchStartItem( event ) { 89 var $this = $( event.currentTarget ).closest( '.jet-custom-nav__item' ); 90 91 $this.data( 'offset', $this.offset().top ); 92 $this.data( 'windowOffset', $( window ).scrollTop() ); 93 } 94 95 function touchEndItem( event ) { 96 var $currentTarget, 97 $this, 98 $siblingsItems, 99 $link, 100 linkHref, 101 subMenu, 102 offset, 103 windowOffset; 104 105 event.preventDefault(); 106 event.stopPropagation(); 107 108 $currentTarget = $( event.currentTarget ); 109 $this = $currentTarget.closest( '.jet-custom-nav__item' ); 110 $siblingsItems = $this.siblings( '.jet-custom-nav__item.menu-item-has-children' ); 111 $link = $( '> a', $this ); 112 linkHref = $link.attr( 'href' ); 113 subMenu = $( '.jet-custom-nav__sub:first, .jet-custom-nav__mega-sub:first', $this ); 114 offset = $this.data( 'offset' ); 115 windowOffset = $this.data( 'windowOffset' ); 116 117 if ( offset !== $this.offset().top || windowOffset !== $( window ).scrollTop() ) { 118 return false; 119 } 120 121 if ( $currentTarget.hasClass( 'jet-dropdown-arrow' ) ) { 122 123 if ( !subMenu[0] ) { 124 return false; 125 } 126 127 if ( ! $this.hasClass( 'hover-state' ) ) { 128 $this.addClass( 'hover-state' ); 129 130 $siblingsItems.removeClass( 'hover-state' ); 131 $( '.jet-custom-nav__item.menu-item-has-children', $siblingsItems ).removeClass( 'hover-state' ); 132 } else { 133 $this.removeClass( 'hover-state' ); 134 135 $( '.jet-custom-nav__item.menu-item-has-children', $this ).removeClass( 'hover-state' ); 136 } 137 } 138 139 if ( $currentTarget.hasClass( 'jet-custom-nav__item-link' ) ) { 140 141 if ( '#' === linkHref ) { 142 if ( ! $this.hasClass( 'hover-state' ) ) { 143 $this.addClass( 'hover-state' ); 144 145 $siblingsItems.removeClass( 'hover-state' ); 146 $( '.jet-custom-nav__item.menu-item-has-children', $siblingsItems ).removeClass( 'hover-state' ); 147 } else { 148 $this.removeClass( 'hover-state' ); 149 150 $( '.jet-custom-nav__item.menu-item-has-children', $this ).removeClass( 'hover-state' ); 151 } 152 } else { 153 154 window.location = linkHref; 155 156 return false;
157 } 158 159 } 160 } 161 162 var initSubMenuPosition = false; 163 164 function setSubMenuPosition(){ 165 if ( initSubMenuPosition ) { 166 $target.find( '.jet-custom-nav__sub.inverse-side' ).removeClass( 'inverse-side' ); 167 initSubMenuPosition = false; 168 } 169 170 var subMenu = $( '.jet-custom-nav__sub', $target ), 171 $body = $( 'body' ), 172 maxWidth = $body.outerWidth( true ), 173 isMobile = 'mobile' === elementor.getCurrentDeviceMode(); 174 175 if ( isMobile ) { 176 return; 177 } 178 179 if ( subMenu[0] ) { 180 subMenu.each( function() { 181 var $this = $( this ), 182 subMenuOffsetLeft = $this.offset().left, 183 subMenuOffsetRight = subMenuOffsetLeft + $this.outerWidth( true ), 184 subMenuPosition = $this.closest( '.jet-custom-nav' ).hasClass( 'jet-custom-nav--dropdown-left-side' ) ? 'left-side' : 'right-side'; 185 186 if ( 'right-side' === subMenuPosition ) { 187 if ( subMenuOffsetRight >= maxWidth ) { 188 $this.addClass( 'inverse-side' ); 189 $this.find( '.jet-custom-nav__sub' ).addClass( 'inverse-side' ); 190 191 initSubMenuPosition = true; 192 } else if ( subMenuOffsetLeft < 0 ) { 193 $this.removeClass( 'inverse-side' ); 194 $this.find( '.jet-custom-nav__sub' ).removeClass( 'inverse-side' ); 195 } 196 } else { 197 if ( subMenuOffsetLeft < 0 ) { 198 $this.addClass( 'inverse-side' ); 199 $this.find( '.jet-custom-nav__sub' ).addClass( 'inverse-side' ); 200 201 initSubMenuPosition = true; 202 } else if ( subMenuOffsetRight >= maxWidth ) { 203 $this.removeClass( 'inverse-side' ); 204 $this.find( '.jet-custom-nav__sub' ).removeClass( 'inverse-side' ); 205 } 206 } 207 } ); 208 } 209 } 210 211 setSubMenuPosition(); 212 $( window ).on( 'resize.JetCustomMenu orientationchange.JetCustomMenu', setSubMenuPosition ); 213 214 var initMaxMegaMenuWidth = false; 215 216 function setMaxMegaMenuWidth(){ 217 var megaMenu = $( '.jet-custom-nav__mega-sub', $target ), 218 $body = $( 'body' ), 219 maxWidth = $body.outerWidth( true ), 220 isMobile = 'mobile' === elementor.getCurrentDeviceMode(); 221 222 if ( initMaxMegaMenuWidth ) { 223 megaMenu.css( { 224 'maxWidth': '' 225 } ); 226 227 initMaxMegaMenuWidth = false; 228 } 229 230 if ( isMobile ) { 231 return; 232 } 233 234 if ( megaMenu[0] ) { 235 megaMenu.each( function() { 236 var $this = $( this ), 237 megaMenuTranslateX = $this.css( 'transform' ).replace( /,/g, "" ).split( " " )[4] || 0, 238 megaMenuOffsetLeft = $this.offset().left - megaMenuTranslateX, 239 megaMenuOffsetRight = megaMenuOffsetLeft + $this.outerWidth( true ), 240 megaMenuPosition = $this.closest( '.jet-custom-nav' ).hasClass( 'jet-custom-nav--dropdown-left-side' ) ? 'left-side' : 'right-side'; 241 242 if ( 'right-side' === megaMenuPosition ) { 243 if ( megaMenuOffsetRight >= maxWidth ) { 244 $this.css({ 245 'maxWidth': maxWidth - megaMenuOffsetLeft - 10 246 }); 247 248 initMaxMegaMenuWidth = true; 249 } 250 } else { 251 if ( megaMenuOffsetLeft < 0 ) { 252 $this.css({ 253 'maxWidth': megaMenuOffsetRight - 10 254 }); 255 256 initMaxMegaMenuWidth = true; 257 } 258 } 259 } ); 260 } 261 } 262 263 setMaxMegaMenuWidth(); 264 $( window ).on( 'resize.JetCustomMenu orientationchange.JetCustomMenu', setMaxMegaMenuWidth ); 265 266 }, 267 268 widgetMobileMenu: function( $scope ) { 269 let $target = $scope.find( '.jet-mobile-menu' ), 270 menuInstanceId = $target.attr( 'id' ), 271 menuId = $target.data( 'menu-id' ) || false, 272 menuOptions = $target.data( 'menu-options' ) || {}; 273 274 if ( ! $target[0] ) { 275 return; 276 } 277 278 window.jetMenu.createMobileRenderInstance( menuInstanceId, menuId, menuOptions ); 279 }, 280 281 /** 282 * Mobile and tablet check funcion. 283 * 284 * @return {boolean} Mobile Status 285 */ 286 mobileAndTabletcheck: function() { 287 var check = false; 288 289 (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
289sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); 290 291 return check; 292 } 293 }; 294 295 $( window ).on( 'elementor/frontend/init', JetMenuWidget.init ); 296 297}( jQuery, window.elementorFrontend ) );
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.