1( function ( $ ) { 2 // Menu fixes 3 function onResizeMenuLayout() { 4 if ( $( window ).width() > 767 ) { 5 $( ".main-menu" ).on( 'hover', '.dropdown', function () { 6 $( this ).addClass( 'open' ) 7 }, 8 function () { 9 $( this ).removeClass( 'open' ) 10 } 11 ); 12 $( ".dropdown" ).on( 'focusin', 13 function () { 14 $( this ).addClass( 'open' ) 15 } 16 ); 17 $( ".dropdown" ).on( 'focusout', 18 function () { 19 $( this ).removeClass( 'open' ) 20 } 21 ); 22 23 } else { 24 $( ".dropdown" ).on( 'hover', 25 function () { 26 $( this ).removeClass( 'open' ) 27 } 28 ); 29 } 30 31 $( '#menu-categories-menu' ).on( 'focusout', function ( e ) { 32 setTimeout( function () { // needed because nothing has focus during 'focusout' 33 if ( $( ':focus' ).closest( '#menu-categories-menu' ).length <= 0 ) { 34 $( "#menu-categories-menu" ).removeClass( "open" ); 35 } 36 }, 0 ); 37 } ); 38 } 39 ; 40 // initial state 41 onResizeMenuLayout(); 42 // on resize 43 $( window ).on( 'resize', onResizeMenuLayout ); 44 45 $( ".envo-categories-menu-first" ).on( 'click hover', function () { 46 $( "#menu-categories-menu" ).toggleClass( "open" ); 47 } ); 48 49 $( ".main-menu" ).on( 'hover', '.navbar .dropdown-toggle', function () { 50 $( this ).addClass( 'disabled' ); 51 } ); 52 $( '.navbar .dropdown-toggle' ).on( 'focus', function () { 53 $( this ).addClass( 'disabled' ); 54 } ); 55 56 $( document ).ready( function () { 57 var $myDiv = $( '#theme-menu' );
58 $(".toggle").click(function(e){ 59 setTimeout(function(){ $('.nav-close-button').filter(':visible').focus(); }, 200); 60 e.preventDefault(); 61 }); 62 63 if ( $myDiv.length ) { 64 $('#theme-menu').hcOffcanvasNav({ 65 disableAt: 768, 66 customToggle: $('.toggle'), 67 levelTitles: false, 68 levelTitleAsBack: false, 69 pushContent: $('.page-wrap') 70 }); 71 } 72 } ); 73 74 $( 'form.cart' ).on( 'click', 'button.plus, button.minus', function () { 75 // Get current quantity values 76 var qty = $( this ).closest( 'form.cart' ).find( '.qty' ); 77 var val = parseFloat( qty.val() ); 78 var max = parseFloat( qty.attr( 'max' ) ); 79 var min = parseFloat( qty.attr( 'min' ) ); 80 var step = parseFloat( qty.attr( 'step' ) ); 81 82 // Change the value if plus or minus 83 if ( $( this ).is( '.plus' ) ) { 84 if ( max && ( max <= val ) ) { 85 qty.val( max ); 86 } else { 87 qty.val( val + step ); 88 } 89 } else { 90 if ( min && ( min >= val ) ) { 91 qty.val( min ); 92 } else if ( val > 1 ) { 93 qty.val( val - step ); 94 } 95 } 96 } ); 97 $( document ).ready( function () { 98 $( '.cart-open .page-wrap' ).on( 'click', function () { 99 $( "body" ).removeClass( "cart-open" ); 100 } ); 101 $( '.site-header-cart .la-times-circle' ).on( 'click', function () { 102 $( "body" ).toggleClass( "cart-open" ); 103 } ); 104 $( '.header-cart' ).on( 'click', function () { 105 $( "body" ).addClass( "cart-open" ); 106 } ); 107 } ); 108 $( '.search-button' ).on( 'click', function ( e ) { 109 $( ".head-form" ).appendTo( ".heading-row" ); 110 $( ".head-form" ).toggleClass( "visible-xs hidden-xs" ); 111 $( ".search-button .la" ).toggleClass( "la-times la-search" ); 112 $( ".header-search-input" ).focus(); 113 } ); 114 $( '.head-form' ).on( 'focusout', function ( e ) { 115 setTimeout( function () { // needed because nothing has focus during 'focusout' 116 if ( $( ':focus' ).closest( '.head-form' ).length <= 0 ) { 117 $( ".head-form" ).removeClass( 'visible-xs' ).addClass( 'hidden-xs' ); 118 $( ".search-button .la" ).removeClass( 'la-times' ).addClass( 'la-search' ); 119 $( ".search-button" ).focus(); 120 $( ".head-form" ).appendTo( ".header-search-widget" ); 121 } 122 }, 0 ); 123 } ); 124 $( document ).ready( function () { 125 $( "body" ).addClass( "js-loaded" ); 126 } ); 127 $(window).on('resize load', function() { 128 if($(window).width() <= 767) { 129 $('body').addClass('mobile'); 130 $('body').removeClass('desktop'); 131 $('body').removeClass('tablet'); 132 } else if ($(window).width() <= 991) { 133 $('body').addClass('tablet'); 134 $('body').removeClass('mobile'); 135 $('body').removeClass('desktop'); 136 } else { 137 $('body').addClass('desktop'); 138 $('body').removeClass('mobile'); 139 $('body').removeClass('tablet'); 140 } 141 }); 142} )( jQuery );
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.