if ($(window).width() < 991) {
$('#primary-menu-trigger,#overlay-menu-close').click(function() {
$('.drawer-bg').show();
$('.mobile-drawer').addClass('show');
});
$('.drawer-bg, .close-drawer').click(function(){
$('.drawer-bg').hide();
$('.mobile-drawer').removeClass('show');
// $('.mobile-drawer-content').removeClass('show');
});
$('.mobile-drawer .navigation > ul > li, .mobile-drawer .navigation > ul > li > ul > li').has('ul').addClass('submenu');
$('.mobile-drawer .currencySection ul > li:has(ul) > a').append( '' );
// $('.mobile-drawer-content').closest('.submenu').addClass('categoryLink');
$('.submenu').on('click',function(e){
e.preventDefault();
var show = $(this).hasClass('show');
var categoryLink = $(this).hasClass('category-link');
if(categoryLink){
$('.mobile-drawer-content').addClass('show');
}else{
if(show){
$(this).removeClass('show');
$(this).find('ul:first').slideUp();
var href = $(this).find('a').data('link');
window.location.href = href;
}else{
$(this).addClass('show');
$(this).find('ul:first').slideDown();
}
$('.mobile-drawer-content').removeClass('show');
}
e.stopPropagation();
});
$('.menu-togggle').on('click',function(){
var show = $(this).find('i').hasClass('.fa fa-chevron-up');
if(show){
$(this).find('i').removeClass('.fa fa-chevron-up').addClass('.fa fa-chevron-down');
$(this).closest('.category-menu').find('ul:first').slideUp();
}else{
$(this).find('i').removeClass('.fa fa-chevron-down').addClass('.fa fa-chevron-up');
$(this).closest('.category-menu').find('ul:first').slideDown();
}
});
$('.category-name').on('click',function(){
var href = $(this).attr('href');
window.location.href= href;
});
$('.category-menu > ul > li > a').on('click',function(){
var href = $(this).attr('href');
window.location.href= href;
});
$('.submenu > ul ').on('click',function(){
e.preventDefault();
var show = $(this).hasClass('show');
e.stopPropagation();
});
$('.mobile-drawer .currencySection ul > li:has(ul)').on('click',function(e){
// e.preventDefault();
var show = $(this).hasClass('show');
if(show){
$(this).removeClass('show');
$(this).find('ul:first').slideUp();
}else{
$(this).addClass('show');
$(this).find('ul:first').slideDown();
}
});
$(window).resize(function(){
if($(window).width() > 991){
$('.mobile-drawer').removeClass('show');
$('.mobile-drawer-content').removeClass('show');
}
});
}
else {
$(window).resize(function(){
if($(window).width() > 991){
$('.mobile-drawer').removeClass('show');
$('.mobile-drawer-content').removeClass('show');
}
});
}
// $('#primary-menu-trigger,#overlay-menu-close').click(function() {
// $('.drawer-bg').show();
// $('.mobile-drawer').addClass('show');
// });
// $('.drawer-bg, .close-drawer').click(function(){
// $('.drawer-bg').hide();
// $('.mobile-drawer').removeClass('show');
// // $('.mobile-drawer-content').removeClass('show');
// });
// $('.mobile-drawer .navigation > ul > li, .mobile-drawer .navigation > ul > li > ul > li').has('ul').addClass('submenu');
// $('.mobile-drawer .currencySection ul > li:has(ul) > a').append( '' );
// // $('.mobile-drawer-content').closest('.submenu').addClass('categoryLink');
// $('.submenu').on('click',function(e){
// e.preventDefault();
// var show = $(this).hasClass('show');
// var categoryLink = $(this).hasClass('category-link');
// if(categoryLink){
// $('.mobile-drawer-content').addClass('show');
// }else{
// if(show){
// $(this).removeClass('show');
// $(this).find('ul:first').slideUp();
// var href = $(this).find('a').data('link');
// window.location.href = href;
// }else{
// $(this).addClass('show');
// $(this).find('ul:first').slideDown();
// }
// $('.mobile-drawer-content').removeClass('show');
// }
// e.stopPropagation();
// });
// $('.menu-togggle').on('click',function(){
// var show = $(this).find('i').hasClass('.fa fa-chevron-up');
// if(show){
// $(this).find('i').removeClass('.fa fa-chevron-up').addClass('.fa fa-chevron-down');
// $(this).closest('.category-menu').find('ul:first').slideUp();
// }else{
// $(this).find('i').removeClass('.fa fa-chevron-down').addClass('.fa fa-chevron-up');
// $(this).closest('.category-menu').find('ul:first').slideDown();
// }
// });
// $('.category-name').on('click',function(){
// var href = $(this).attr('href');
// window.location.href= href;
// });
// $('.category-menu > ul > li > a').on('click',function(){
// var href = $(this).attr('href');
// window.location.href= href;
// });
// $('.submenu > ul ').on('click',function(){
// e.preventDefault();
// var show = $(this).hasClass('show');
// e.stopPropagation();
// });
// $('.mobile-drawer .currencySection ul > li:has(ul)').on('click',function(e){
// // e.preventDefault();
// var show = $(this).hasClass('show');
// if(show){
// $(this).removeClass('show');
// $(this).find('ul:first').slideUp();
// }else{
// $(this).addClass('show');
// $(this).find('ul:first').slideDown();
// }
// });
// $(window).resize(function(){
// if($(window).width() > 991){
// $('.mobile-drawer').removeClass('show');
// $('.mobile-drawer-content').removeClass('show');
// }
// });