//left pane $('#side-drawer,#primary-menu-trigger,#overlay-menu-close').click(function(e) { e.preventDefault(); $('.drawer-bg').show(); $('.mobile-drawer').addClass('show'); }); $('.drawer-bg, .close-drawer').click(function(){ $('.drawer-bg').hide(); $('.mobile-drawer').removeClass('show'); $('.mobile-right-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( '' ); $('.submenu > 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(); $(this).find('.toggleArrow').removeClass('fa-angle-down').addClass('fa-angle-right'); // var href = $(this).find('a').data('link'); // window.location.href = href; }else{ $(this).addClass('show'); $(this).find('ul:first').slideDown(); $(this).find('.toggleArrow').removeClass('fa-angle-right').addClass('fa-angle-down'); } $('.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; }); $('.submenu > ul > li > a').on('click',function(e){ var href = $(this).attr('href'); window.location.href= href; e.stopPropagation(); }); $('.category-menu > ul > li > a').on('click',function(){ var href = $(this).attr('href'); // window.location.href= href; }); $('.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(); } }); //right pane $('.right-pane-trigger').on('click',function(){ $('.drawer-bg').show(); $('.mobile-right-drawer').addClass('show'); }); $(window).resize(function(){ if($(window).width() > 991){ $('.mobile-drawer').removeClass('show'); $('.mobile-right-drawer').removeClass('show'); $('.mobile-drawer-content').removeClass('show'); } });