mirror of
https://github.com/stisla/stisla.git
synced 2025-08-31 20:02:00 +02:00
fix sidebar-menu nav-item dropdown always open
This commit is contained in:
@@ -89,25 +89,28 @@ $(function() {
|
||||
sidebar_nicescroll = $(".main-sidebar").getNiceScroll();
|
||||
|
||||
$(".main-sidebar .sidebar-menu li a.has-dropdown").off('click').on('click', function() {
|
||||
var me = $(this);
|
||||
|
||||
var me = $(this);
|
||||
var active = false;
|
||||
if(me.parent().hasClass("active")){
|
||||
active = true;
|
||||
}
|
||||
|
||||
$('.main-sidebar .sidebar-menu li.active > .dropdown-menu').slideUp(500, function() {
|
||||
update_sidebar_nicescroll();
|
||||
update_sidebar_nicescroll();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.main-sidebar .sidebar-menu li.active').removeClass('active');
|
||||
|
||||
if(me.parent().hasClass("active")) {
|
||||
me.parent().removeClass('active');
|
||||
|
||||
me.parent().find('> .dropdown-menu').slideUp(500, function() {
|
||||
if(active==true) {
|
||||
me.parent().removeClass('active');
|
||||
me.parent().find('> .dropdown-menu').slideUp(500, function() {
|
||||
update_sidebar_nicescroll();
|
||||
return false;
|
||||
});
|
||||
}else{
|
||||
me.parent().addClass('active');
|
||||
|
||||
me.parent().find('> .dropdown-menu').slideDown(500, function() {
|
||||
me.parent().addClass('active');
|
||||
me.parent().find('> .dropdown-menu').slideDown(500, function() {
|
||||
update_sidebar_nicescroll();
|
||||
return false;
|
||||
});
|
||||
@@ -117,7 +120,7 @@ $(function() {
|
||||
});
|
||||
|
||||
$('.main-sidebar .sidebar-menu li.active > .dropdown-menu').slideDown(500, function() {
|
||||
update_sidebar_nicescroll();
|
||||
update_sidebar_nicescroll();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user