const cur_url = window.location.href.split('#')[0].split('?')[0],
body = $('body'),
menu_toggle = $('.menu-toggle'),
sidebar_menu = $('#sidebar-menu');
initSidebar = function() {
let openUpMenu = function() {
sidebar_menu.find('li').removeClass('active active-sm');
sidebar_menu.find('li ul').slideUp();
}
sidebar_menu.find('a').on('click', function(ev) {
let $li = $(this).parent();
$li.is('.active') ? $li.removeClass('active active-sm') : $li.addClass('active');
});
// toggle small or large menu
menu_toggle.on('click', function() {
if (body.hasClass('nav-md')) {
sidebar_menu.find('li.active ul').hide();
sidebar_menu.find('li.active').addClass('active-sm').removeClass('active');
} else {
sidebar_menu.find('li.active-sm ul').show();
sidebar_menu.find('li.active-sm').addClass('active').removeClass('active-sm');
}
body.toggleClass('nav-md nav-sm');
});
};
$(document).ready(function() {
initSidebar();
});
.left_col {
background: #2A3F54;
}
/* CSS Rules Go Here */
Additional context goes here. You can mention specific issues, requirements, or challenges you are facing with the current code implementation. Provide a clear description of what you need help with.
You can access the working example code on this link: https://jsfiddle.net/dmilos89/cyxj7f98/