{"version":3,"sources":["assets/js/navigation.js"],"names":["$","window","on","e","preventDefault","this","toggleClass","height","innerHeight","hasClass","slideToggle","width","resizeMenu","removeClass","adminBar","length","menuHeight","outerHeight","jQuery","document"],"mappings":"cAGC,SAAWA,EAAGC,GAKXD,EAAA,mCAAAE,GAAA,QAAA,SAAAC,GAIIA,EAAEC,iBAEFJ,EAAEK,MAAMC,YAAY,UAFlBF,EAAAA,MAAAA,SAAF,UAEQE,EAAAA,QAAAA,SAAY,aAApBC,OAAAN,EAAAO,YAAA,MAEKR,EAAD,QAAOS,YAAX,aAA8BF,OAAA,QAGxBP,EAAA,6BAAFU,YAA0C,OA4BlDV,EAMJC,GAAAC,GAAA,gCAAA,YA1CI,WAgBI,GAAuB,KAApBF,EAAEC,GAAQU,SAAkBX,EAAE,QAAQS,SAAS,aAD7CG,EAAAA,QAATC,YAAqB,aAAAN,OAAA,QACZN,EAAAA,6BAA4BS,YAAiB,GAC5CV,EAAD,mCAAyCM,YAA1C,cACE,CAED,IAAAQ,EAAA,EAIEd,EAAE,eAAee,SAAfD,EAAeC,EAAAA,GAAOJ,SAAA,IAAAX,EAAA,eAAAe,OAAA,GAAA,IAI3B,IAAIC,EAAahB,EAAEC,GAAQM,SAAWP,EAAE,qBAAqBO,SAAWO,EAEtEd,EAAA,6BAA6BiB,YAAYD,IAavDJ,KAnDC,CAoJEM,OAAQjB,OAAQkB","file":"navigation.min.js","sourcesContent":["/**\n * Header menu\n */\n;(function ($, window, document, undefined) {\n 'use strict';\n\n\n /*=================================*/\n /* MOBILE MENU */\n /*=================================*/\n\n $('.ewo-header--mob-nav__hamburger').on('click', function (e) {\n e.preventDefault();\n\n $(this).toggleClass('active');\n\n if($(this).hasClass('active')){\n $('html').addClass('no-scroll').height(window.innerHeight + 'px');\n }else{\n $('html').removeClass('no-scroll').height('auto');\n }\n\n $('.ewo-header--menu-wrapper').slideToggle(250);\n\n });\n\n function resizeMenu(){\n if($(window).width() > 1199 && $('html').hasClass('no-scroll')){\n $('html').removeClass('no-scroll').height('auto');\n $('.ewo-header--menu-wrapper').slideToggle(0);\n $('.ewo-header--mob-nav__hamburger').toggleClass('active');\n }else{\n\n var adminBar = 0;\n\n if($('#wpadminbar').length){\n adminBar = $(window).width() && $('#wpadminbar').length > 782 ? 32 : 46;\n }\n\n var menuHeight = $(window).height() - $('.ewo-header--wrap').height() - adminBar;\n\n $('.ewo-header--menu-wrapper').outerHeight(menuHeight);\n }\n }\n\n\n\n $(window).on('load resize orientationchange', function () {\n resizeMenu();\n })\n\n\n\n// \tvar container, button, menu, links, i, len;\n//\n// \tcontainer = document.getElementById( 'site-navigation' );\n// \tif ( ! container ) {\n// \t\treturn;\n// \t}\n//\n// \tbutton = container.getElementsByTagName( 'button' )[0];\n// \tif ( 'undefined' === typeof button ) {\n// \t\treturn;\n// \t}\n//\n// \tmenu = container.getElementsByTagName( 'ul' )[0];\n//\n// \t// Hide menu toggle button if menu is empty and return early.\n// \tif ( 'undefined' === typeof menu ) {\n// \t\tbutton.style.display = 'none';\n// \t\treturn;\n// \t}\n//\n// \tmenu.setAttribute( 'aria-expanded', 'false' );\n// \tif ( -1 === menu.className.indexOf( 'nav-menu' ) ) {\n// \t\tmenu.className += ' nav-menu';\n// \t}\n//\n// \tbutton.onclick = function() {\n// \t\tif ( -1 !== container.className.indexOf( 'toggled' ) ) {\n// \t\t\tcontainer.className = container.className.replace( ' toggled', '' );\n// \t\t\tbutton.setAttribute( 'aria-expanded', 'false' );\n// \t\t\tmenu.setAttribute( 'aria-expanded', 'false' );\n// \t\t} else {\n// \t\t\tcontainer.className += ' toggled';\n// \t\t\tbutton.setAttribute( 'aria-expanded', 'true' );\n// \t\t\tmenu.setAttribute( 'aria-expanded', 'true' );\n// \t\t}\n// \t};\n//\n// \t// Get all the link elements within the menu.\n// \tlinks = menu.getElementsByTagName( 'a' );\n//\n// \t// Each time a menu link is focused or blurred, toggle focus.\n// \tfor ( i = 0, len = links.length; i < len; i++ ) {\n// \t\tlinks[i].addEventListener( 'focus', toggleFocus, true );\n// \t\tlinks[i].addEventListener( 'blur', toggleFocus, true );\n// \t}\n//\n// \t/**\n// \t * Sets or removes .focus class on an element.\n// \t */\n// \tfunction toggleFocus() {\n// \t\tvar self = this;\n//\n// \t\t// Move up through the ancestors of the current link until we hit .nav-menu.\n// \t\twhile ( -1 === self.className.indexOf( 'nav-menu' ) ) {\n//\n// \t\t\t// On li elements toggle the class .focus.\n// \t\t\tif ( 'li' === self.tagName.toLowerCase() ) {\n// \t\t\t\tif ( -1 !== self.className.indexOf( 'focus' ) ) {\n// \t\t\t\t\tself.className = self.className.replace( ' focus', '' );\n// \t\t\t\t} else {\n// \t\t\t\t\tself.className += ' focus';\n// \t\t\t\t}\n// \t\t\t}\n//\n// \t\t\tself = self.parentElement;\n// \t\t}\n// \t}\n//\n// \t/**\n// \t * Toggles `focus` class to allow submenu access on tablets.\n// \t */\n// \t( function( container ) {\n// \t\tvar touchStartFn, i,\n// \t\t\tparentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );\n//\n// \t\tif ( 'ontouchstart' in window ) {\n// \t\t\ttouchStartFn = function( e ) {\n// \t\t\t\tvar menuItem = this.parentNode, i;\n//\n// \t\t\t\tif ( ! menuItem.classList.contains( 'focus' ) ) {\n// \t\t\t\t\te.preventDefault();\n// \t\t\t\t\tfor ( i = 0; i < menuItem.parentNode.children.length; ++i ) {\n// \t\t\t\t\t\tif ( menuItem === menuItem.parentNode.children[i] ) {\n// \t\t\t\t\t\t\tcontinue;\n// \t\t\t\t\t\t}\n// \t\t\t\t\t\tmenuItem.parentNode.children[i].classList.remove( 'focus' );\n// \t\t\t\t\t}\n// \t\t\t\t\tmenuItem.classList.add( 'focus' );\n// \t\t\t\t} else {\n// \t\t\t\t\tmenuItem.classList.remove( 'focus' );\n// \t\t\t\t}\n// \t\t\t};\n//\n// \t\t\tfor ( i = 0; i < parentLink.length; ++i ) {\n// \t\t\t\tparentLink[i].addEventListener( 'touchstart', touchStartFn, false );\n// \t\t\t}\n// \t\t}\n// \t}( container ) );\n})(jQuery, window, document);\n"]}