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

3º level menu not working on mobile #471

Closed jonasreichel closed 7 years ago

jonasreichel commented 7 years ago

Hello.

The 3º level of menu is not working on mobile. Its's closing.

kevingogomez commented 7 years ago

I really don't know why that is happening. Should be it's a problem when you have the reduced sidebar. And the class "sub-menu" doesn't exists for the template on mobile devices...

AndreiCN commented 7 years ago

Thank you for pointing this out , will investigate this and come with a solution as soon as possible.

SumonT2 commented 7 years ago

Hi I have fixed the issue. :)

use code below

 $SIDEBAR_MENU.find('a').on('click', function(ev) {
        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" ) )
                {
                    if (!$li.parent().is('.child_menu')) {
                        $SIDEBAR_MENU.find('li').removeClass('active active-sm');
                        $SIDEBAR_MENU.find('li ul').slideUp();
                    }
                }
            }
            $li.addClass('active');

            $('ul:first', $li).slideDown(function() {

            });
        }
    });