1( function( $ ) { 2 3 $( document ).ready( function() { 4 5 //Mobile header = Widget ACart 6 $('header .widgetcart .iconbtn').on('click', function(){ 7 $('.site').addClass('open-widgetcart'); 8 }); 9 $('header .widgetcart .close').on('click', function(){ 10 $('.site').removeClass('open-widgetcart'); 11 }); 12 $('header .widgetcart .view-cart-wrap').on('click', function(){ 13 $('.site').removeClass('open-widgetcart'); 14 }); 15 16 //Mobile header = Membership 17 $('header .membership .iconbtn').on('click', function(){ 18 $('.site').addClass('open-membership'); 19 }); 20 $('header .membership .close').on('click', function(){ 21 $('.site').removeClass('open-membership'); 22 }); 23 $('header .membership .over-inner').on('click', function(){ 24 $('.site').removeClass('open-membership'); 25 }); 26 27 28 29 var windowWidth = window.innerWidth; 30 var html = $('html'); 31 var mb_menu = document.getElementById('mobile-menu'); 32 33 34 if ( windowWidth <= 1000 ) { 35 36 var movefun = function( event ) { 37 event.preventDefault(); 38 } 39 40 //Mobile header = Menu 41 $('header .menus .iconbtn').on('click', function(){ 42 $('.site').addClass('open-menu'); 43 html.css('overflow-y', 'hidden'); 44 $('#mobile-menu').css('overflow-y', 'scroll'); 45 }); 46 $('header .mobile-menu .close').on('click', function(){ 47 $('.site').removeClass('open-menu'); 48 html.css('overflow-y', 'scroll'); 49 mb_menu.removeEventListener('touchmove', movefun , { passive: false } ); 50 }); 51 $('.gray-bg').on('click', function(){ 52 $('.site').removeClass('open-menu'); 53 html.css('overflow-y', 'scroll'); 54 mb_menu.removeEventListener('touchmove', movefun , { passive: false } ); 55 }); 56 } 57 58 $('#show li.list').on('click', function(){ 59 $('#show li.list').addClass('current'); 60 $('.product-list').addClass('layout-list'); 61 if($('.product-list').hasClass('layout-grid')){ 62 $('.product-list').removeClass('layout-grid'); 63 } 64 if($('#show li.grid').hasClass('current')){ 65 $('#show li.grid').removeClass('current'); 66 } 67 }); 68 $('#show li.grid').on('click', function(){ 69 $('#show li.grid').addClass('current'); 70 $('.product-list').addClass('layout-grid'); 71 if($('.product-list').hasClass('layout-list')){ 72 $('.product-list').removeClass('layout-list'); 73 } 74 if($('#show li.list').hasClass('current')){ 75 $('#show li.list').removeClass('current'); 76 } 77 }); 78 79 //addClass 80 $('.widget_welcart_featured .ucart_featured_body').addClass('cf'); 81 $('.widget_welcart_bestseller .ucart_widget_body').addClass('cf'); 82 83 } ); 84 85 $(window).on('load resize', function() { 86 var windowWidth = window.innerWidth; 87 var windowHeight = window.innerHeight; 88 var SubNav = $('.sub-navigation ul').innerWidth(); 89 90 if ( 1000 <= windowWidth ) { 91 $('.site-description').css('margin-right', SubNav + 54 + 'px'); 92 } else { 93 $('.site-description').css('margin-right', 0); 94 } 95 96 97 var mb_menu = document.getElementById('mobile-menu'); 98 var html = $('html'); 99 100 if ( windowWidth <= 1000 ) { 101 102 //Mobile header = Menu 103 $('header .menus .iconbtn').on('click', function(){ 104 105 mb_menu.addEventListener('touchmove', function(e) { 106 var scroll = mb_menu.scrollTop; 107 var range = mb_menu.scrollHeight - mb_menu.offsetHeight - 1; 108 if (scroll < 1) { 109 e.preventDefault(); 110 mb_menu.scrollTop = 1; 111 } else if(scroll > range) { 112 e.preventDefault(); 113 mb_menu.scrollTop = range; 114 } 115 }); 116 117 $('header .menus .iconbtn').on('click', function(){ 118 $('.site').addClass('open-menu'); 119 }); 120 $('header .mobile-menu .close').on('click', function(){ 121 $('.site').removeClass('open-menu'); 122 }); 123 $('.gray-bg').on('click', function(){ 124 $('.site').removeClass('open-menu'); 125 }); 126 127 }); 128 129 $('#mobile-menu').css('height', windowHeight + 'px' ); 130 131 } else { 132 $('#mobile-menu').css('height', 'auto' ); 133 $('#mobile-menu').css('overflow-y', 'unset'); 134 html.css('overflow-y', 'scroll'); 135 } 136 137 }); 138 139 $(function() { 140 var pair = location.search.substring(1).split('&'); 141 var arg = new Object; 142 for( var i = 0; pair[i]; i++ ) { 143 var kv = pair[i].split('='); 144 arg[kv[0]] = kv[1]; 145 } 146 if( undefined != arg.from_item && undefined != arg.from_sku ) { 147 $('.wpcf7-submit').on('click', function() { 148 var form = $(this).parents('form'); 149 form.attr('action', $(this).data('action')); 150 $('<input>').attr({ 151 'type': 'hidden', 152 'name': 'from_item', 153 'value': arg.from_item 154 }).appendTo(form); 155 $('<input>').attr({ 156 'type': 'hidden', 157 'name': 'from_sku', 158 'value': arg.from_sku 159 }).appendTo(form); 160 }); 161 } 162 }); 163 164 165} )( 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.