(function($){ "use strict"; jQuery(document).on('mouseup',function (e){ var container=jQuery('.header-search .product-categories'); var container_cart; if(!container.is(e.target)&&container.has(e.target).length===0&&!jQuery('.cate-toggler').is(e.target)){ if(jQuery('.header-search .product-categories').hasClass('open')){ jQuery('.header-search .product-categories').removeClass('open'); }} container=jQuery('.atc-notice-wrapper'); if(!container.is(e.target)&&container.has(e.target).length===0){ jQuery('.atc-notice-wrapper').fadeOut(); } container=jQuery('.searchform'); if(!container.is(e.target)&&container.has(e.target).length===0){ jQuery(".ws").removeClass("show"); }}); var heightbody=jQuery('.page-wrapper').height(); if(heightbody < jQuery(window).height()){ jQuery('body').addClass('small-body'); }else{ jQuery('body').removeClass('small-body'); } var oldCateMenuH, realMMH, realCateMenuH; jQuery(document).ready(function(){ if(jQuery('.categories-menu-container').length > 0||jQuery('.categories-menu > ul').length > 0){ jQuery('.morelesscate').css('display', 'none'); jQuery('.morelesscate').addClass('alwayshide'); } if(jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length < debaco_menu_number){ jQuery('.morelesscate').css('display', 'none'); jQuery('.morelesscate').addClass('alwayshide'); } oldCateMenuH=debaco_menu_number * jQuery('#categories ul.mega_main_menu_ul > li.menu-item').outerHeight() + jQuery('.morelesscate').outerHeight() ; realMMH=jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length * jQuery('#categories ul.mega_main_menu_ul > li.menu-item').outerHeight(); realCateMenuH=realMMH + jQuery('.morelesscate').outerHeight() ; if(jQuery('#categories').css('display')=='block'){ jQuery('.categories-menu').addClass('show'); jQuery('.catemenu-inner').css('height', oldCateMenuH); if(jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length < debaco_menu_number){ jQuery('.catemenu-inner').css('height', realMMH); }}else{ jQuery('.categories-menu').removeClass('show'); jQuery('.catemenu-inner').css('height', realCateMenuH); } if(jQuery('.categories-menu-container').length > 0||jQuery('.categories-menu > ul').length > 0){ oldCateMenuH=jQuery('ul.categories-menu > li.menu-item').length * jQuery('ul.categories-menu > li.menu-item').outerHeight(); jQuery('.catemenu-inner').css('height', oldCateMenuH); } jQuery('.catemenu-toggler').on('click', function(){ if(jQuery('.categories-menu > ul').css('display')=='none'){ jQuery('.categories-menu > ul').css('display', 'block'); }else{ jQuery('.categories-menu > ul').css('display', 'none'); } if(jQuery('.categories-menu-container').css('display')=='none'){ jQuery('.categories-menu').addClass('show'); jQuery('.catemenu-inner').css({'height': 'auto'}); jQuery('.categories-menu-container').css('display', 'block'); }else{ jQuery('.categories-menu').removeClass('show'); jQuery('.catemenu-inner').css({'height': 0}); jQuery('.categories-menu-container').css('display', 'none'); } if(jQuery('#categories').css('display')=='none'){ jQuery('.categories-menu').addClass('show'); jQuery('#categories').css('display', 'block'); jQuery('#categories').animate({'opacity': 1}, 100, function(){ if(!jQuery('.morelesscate').hasClass('alwayshide')){ jQuery('.morelesscate').fadeIn('fast'); } oldCateMenuH=debaco_menu_number * jQuery('#categories ul.mega_main_menu_ul > li.menu-item').outerHeight() + jQuery('.morelesscate').outerHeight(); realMMH=jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length * jQuery('#categories ul.mega_main_menu_ul > li').outerHeight(); realCateMenuH=realMMH + jQuery('.morelesscate').outerHeight(); if(jQuery('.morecate').css('display')=='none'){ jQuery('.catemenu-inner').css({'height': realCateMenuH}); }else{ jQuery('.catemenu-inner').css({'height': oldCateMenuH}); if(jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length < debaco_menu_number){ jQuery('.catemenu-inner').css('height', realMMH); }} }); }else{ jQuery('#categories').animate({'opacity': 0}, 200, function(){ jQuery('.categories-menu').removeClass('show'); jQuery('#categories').css('display', 'none'); jQuery('.morelesscate').css('display', 'none'); oldCateMenuH=debaco_menu_number * jQuery('#categories ul.mega_main_menu_ul > li.menu-item').outerHeight(); realMMH=jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length * jQuery('#categories ul.mega_main_menu_ul > li').outerHeight(); realCateMenuH=realMMH + jQuery('.morelesscate').outerHeight(); jQuery('.catemenu-inner').css({'height': oldCateMenuH}); }); }}); var catemidx=1; jQuery('#categories ul.mega_main_menu_ul > li').each(function(){ if(catemidx > debaco_menu_number&&jQuery('.morecate').css('display')!='none'){ jQuery(this).css('display', 'none'); jQuery(this).addClass('mhide'); } catemidx++; }); jQuery('.morelesscate').on('click', function(){ oldCateMenuH=debaco_menu_number * jQuery('#categories ul.mega_main_menu_ul > li.menu-item').outerHeight() + jQuery('.morelesscate').outerHeight(); realMMH=jQuery('#categories ul.mega_main_menu_ul > li.menu-item').length * jQuery('#categories ul.mega_main_menu_ul > li').outerHeight(); realCateMenuH=realMMH + jQuery('.morelesscate').outerHeight(); if(jQuery('.morecate').css('display')=='none'){ jQuery('.catemenu-inner').animate({'height': oldCateMenuH}, function(){ jQuery('.morecate').css('display', 'block'); jQuery('.lesscate').css('display', 'none'); jQuery('.mhide').css('display', 'none'); }); }else{ jQuery('.mhide').css('display', 'block'); jQuery('.catemenu-inner').animate({'height': realCateMenuH}, function(){ jQuery('.morecate').css('display', 'none'); jQuery('.lesscate').css('display', 'block'); }); }}); jQuery(".wsearchsubmit").on('click',function(){ if(jQuery(".ws").width()==0){ if(jQuery(".ws").hasClass("show")){ jQuery(".ws").removeClass("show"); }else{ jQuery(".ws").addClass("show"); return false; }} }); jQuery('.search-dropdown').on('mouseover', function(){ jQuery(this).find('.searchform').stop(true, true).slideDown(); }); jQuery('.search-dropdown').on('mouseleave', function(){ jQuery(this).find('.searchform').stop(true, true).slideUp(); }); jQuery('.wpml-ls .wpml-ls-sub-menu li').parent().addClass('hasChild'); var item_procat='.product-categories > li'; jQuery(item_procat).on('click', function(){ if(jQuery(this).hasClass('hidesub')){ jQuery(this).removeClass('hidesub').find('.children').slideUp(); }else{ jQuery(item_procat).removeClass('hidesub').find('.children').slideUp(); jQuery(this).addClass('hidesub').find('.children').slideDown(); }}); jQuery('.vmenu-toggler').on('mouseover', function(){ jQuery(this).find('.vmenu-content').stop(true, true).slideDown(); }); jQuery('.vmenu-toggler').on('mouseleave', function(){ jQuery(this).find('.vmenu-content').stop(true, true).slideUp(); }); jQuery('.horizontal-menu .nav-menu > ul').superfish({ delay: 100, speed: 'fast' }); jQuery('.primary-menu-container ul.nav-menu').superfish({ delay: 100, speed: 'fast' }); jQuery('.mobile-menu').each(function(){ var mobileMenuWrapper=jQuery(this).find('.mobile-menu-container'); mobileMenuWrapper.find('.menu-item-has-children').each(function(){ var linkItem=jQuery(this).find('a').first(); linkItem.after(''); }); var totalMenuLevelFirst=jQuery(this).find('.mobile-menu-container .nav-menu > li').length; var mobileMenuH=totalMenuLevelFirst*40 + 10; jQuery('.mbmenu-toggler').on('click', function(){ var mobileMenuHi=jQuery('div.nav-menu > ul').outerHeight(); if(jQuery('.mobile-menu div.nav-menu').outerHeight()==0){ jQuery('.mobile-menu div.nav-menu').animate({'height': mobileMenuHi}, 'fast'); }else{ jQuery('.mobile-menu div.nav-menu').animate({'height': 0}, 'fast'); } if(mobileMenuWrapper.hasClass('open')){ mobileMenuWrapper.removeClass('open'); mobileMenuWrapper.animate({'height': 0}, 'fast'); }else{ mobileMenuWrapper.addClass('open'); mobileMenuWrapper.animate({'height': mobileMenuH}, 'fast'); }}); jQuery(this).find('.mobile-menu-container li.menu-item-has-children').each(function(){ jQuery(this).css({'height': 40, 'overflow': 'hidden'}); }); jQuery(this).find('.mobile-menu-container li.menu-item-has-children').each(function(){ var parentLi=jQuery(this); var dropdownUl=parentLi.find('ul.sub-menu').first(); parentLi.find('.fa').first().on('click', function(){ parentLi.parents('li.menu-item-has-children').css('height', 'auto'); mobileMenuWrapper.css({'height': 'auto'}); var dropdownUlheight=dropdownUl.outerHeight() + 40; if(parentLi.hasClass('opensubmenu')){ parentLi.removeClass('opensubmenu'); parentLi.animate({'height': 40}, 'fast', function(){ mobileMenuH=mobileMenuWrapper.outerHeight(); }); parentLi.find('.fa').first().removeClass('fa-angle-down'); parentLi.find('.fa').first().addClass(' fa-angle-right'); }else{ parentLi.addClass('opensubmenu'); parentLi.animate({'height': dropdownUlheight}, 'fast', function(){ mobileMenuH=mobileMenuWrapper.outerHeight(); }); parentLi.find('.fa').first().addClass('fa-angle-down'); parentLi.find('.fa').first().removeClass(' fa-angle-right'); }}); }); }); if(jQuery(window).width() > 1024){ jQuery('.widget_shopping_cart').each(function(){ jQuery(this).on('mouseover', function(){ var mCartHeight=jQuery(this).find('.mini_cart_inner').outerHeight(); var cCartHeight=jQuery(this).find('.mini_cart_content').outerHeight(); if(cCartHeight < mCartHeight){ jQuery(this).find('.mini_cart_content').stop(true, false).animate({'height': mCartHeight}); }}); jQuery(this).on('mouseleave', function(){ jQuery(this).find('.mini_cart_content').animate({'height':'0'}); }); }); } jQuery('.widget_shopping_cart').each(function(){ jQuery(this).on('click', function(event){ if(jQuery(window).width() < 1025){ var closed=false; var mCartHeight=jQuery(this).find('.mini_cart_inner').outerHeight(); var mCartToggler=jQuery(this).find('.cart-toggler'); if(jQuery(this).find('.mini_cart_content').height()==0){ closed=true; } if(mCartToggler.is(event.target)||mCartToggler.has(event.target).length!=0||mCartToggler.is(event.target)){ event.preventDefault(); if(closed){ jQuery(this).find('.mini_cart_content').animate({'height': mCartHeight}); closed=false; }else{ jQuery(this).find('.mini_cart_content').animate({'height':'0'}, function(){ closed=true; }); }} }}); }); var cateToggler=jQuery('.cate-toggler'); jQuery('.header-search .product-categories').prepend('
'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"
"),a.$form.find(".wc-no-matching-variations").slideDown(200)))},complete:function(){a.$form.unblock()}});else{a.$form.trigger("update_variation_values");var r=a.findMatchingVariations(a.variationData,e).shift();r?a.$form.trigger("found_variation",[r]):(a.$form.trigger("reset_data"),i.chosenCount=0,a.loading||(a.$form.find(".single_variation").after(''+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"
"),a.$form.find(".wc-no-matching-variations").slideDown(200)))}else a.$form.trigger("update_variation_values"),a.$form.trigger("reset_data");a.toggleResetLink(0