1(function( $ ) { 2 // Menu fixes 3 function onResizeMenuLayout() { 4 if ( $( window ).width() > 767 ) { 5 $( ".dropdown" ).hover( 6 function () { 7 $( this ).addClass( 'open' ) 8 }, 9 function () { 10 $( this ).removeClass( 'open' ) 11 } 12 ); 13 } else { 14 $( ".dropdown" ).hover( 15 function () { 16 $( this ).removeClass( 'open' ) 17 } 18 ); 19 } 20 } 21 ; 22 // initial state 23 onResizeMenuLayout(); 24 // on resize 25 $( window ).on( 'resize', onResizeMenuLayout ); 26 27 $( '.navbar .dropdown-toggle' ).hover( function () { 28 $( this ).addClass( 'disabled' ); 29 } ); 30 31 $( window ).scroll( function () { 32 var header = $( '.site-header' ).outerHeight(); 33 if ( $( document ).scrollTop() > ( header + 50 ) ) { 34 $( '.header-cart' ).addClass( 'float-cart' ); 35 $( '.header-my-account' ).addClass( 'float-login' ); 36 } else { 37 $( '.header-cart' ).removeClass( 'float-cart' ); 38 $( '.header-my-account' ).removeClass( 'float-login' ); 39 } 40 } ); 41 42 var $myDiv = $( '#my-menu' ); 43 44 $( document ).ready( function() { 45 if ( $myDiv.length ) { 46 mmenu = mmlight( document.querySelector( "#my-menu" ) ); 47 mmenu.create( "(max-width: 767px)" ); 48 mmenu.init( "selected" ); 49 $( "#main-menu-panel" ).click( function ( e ) { 50 e.preventDefault(); 51 if ($("#my-menu").hasClass( "mm--open" )) { 52 mmenu.close(); 53 $( this ).removeClass( "open" ); 54 } else { 55 mmenu.open(); 56 $( this ).addClass( "open" ); 57 } 58 e.stopPropagation(); 59 } ); 60 } 61 }); 62 63 $( 'form.cart' ).on( 'click', 'button.plus, button.minus', function () { 64 65 // Get current quantity values 66 var qty = $( this ).closest( 'form.cart' ).find( '.qty' ); 67 var val = parseFloat( qty.val() ); 68 var max = parseFloat( qty.attr( 'max' ) ); 69 var min = parseFloat( qty.attr( 'min' ) ); 70 var step = parseFloat( qty.attr( 'step' ) ); 71 72 // Change the value if plus or minus 73 if ( $( this ).is( '.plus' ) ) { 74 if ( max && ( max <= val ) ) { 75 qty.val( max ); 76 } else { 77 qty.val( val + step ); 78 } 79 } else { 80 if ( min && ( min >= val ) ) { 81 qty.val( min ); 82 } else if ( val > 1 ) { 83 qty.val( val - step ); 84 } 85 } 86 87 } ); 88 89})( 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.