ColorlibHQ / gentelella

Free Bootstrap 4 Admin Dashboard Template
https://colorlib.com/polygon/gentelella/index.html
MIT License
21.07k stars 6.86k forks source link

Multilevel menu broken, on small screen #459

Closed Kaylleur closed 7 years ago

Kaylleur commented 7 years ago

Hi,

I have found a little bug. On small screen or smartphone when you try to open the "level two" in "Multilevel menu", this close the "level one" and do not open it.

image

landervs commented 7 years ago

I noticed this bug too.

vitorlans commented 7 years ago

I Commented this line that was inside if condition $BODY.is( ".nav-sm" ) -> $SIDEBAR_MENU.find( "li ul" ).slideUp();, so it started to work correctly, But I don't know, if it's right way to solve the problem.

file: custom.js piece of code:

 $SIDEBAR_MENU.find('a').on('click', function(ev) {
      console.log('clicked - sidebar_menu');
        var $li = $(this).parent();

        if ($li.is('.active')) {
            $li.removeClass('active active-sm');
            $('ul:first', $li).slideUp(function() {
                setContentHeight();
            });
        } else {
            // prevent closing menu if we are on child menu
            if (!$li.parent().is('.child_menu')) {
                $SIDEBAR_MENU.find('li').removeClass('active active-sm');
                $SIDEBAR_MENU.find('li ul').slideUp();
            }else
            {
        if ( $BODY.is( ".nav-sm" ) )
        {
            $SIDEBAR_MENU.find( "li" ).removeClass( "active active-sm" );
            //$SIDEBAR_MENU.find( "li ul" ).slideUp(); <-- I Commented that line and its works
        }
        }
            $li.addClass('active');

            $('ul:first', $li).slideDown(function() {
                setContentHeight();
            });
        }
    });
AndreiCN commented 7 years ago

Thank you guys for this , we are already aware of it, are some duplicate tickets of this problem, we will solve it as soon as possible.