gentelella angular admin panel - gentelella toggle menu and sidebar click event not working

1.8k Views Asked by At

I am developing an application on angularJS with gentelella admin panel. I have some issues.

 <div class="nav toggle">
    <a href="javascript:;" id="menu_toggle"><i class="fa fa-bars"></i></a>
 </div>

this is html snippet. but toggling not working. I have checked all loaded js files. there I have found $MENU_TOGGLE.on('click') but it is not firing.

EDIT this code from gentelella/custom.js

var $MENU_TOGGLE = $('#menu_toggle');
$MENU_TOGGLE.on('click', function() {
        console.log('clicked - menu toggle');

        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');

    setContentHeight();
});
3

There are 3 best solutions below

0
On

Try this

 <a href="javascript:;"id="menu_toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-bars"></i></a>

Or you can prefer fiddle

0
On

Make sure you have the correct scripts on the page. The original scripts. I removed a script and it stopped working.

0
On

check the order of how cdn and jquery files are loaded...moving that from bottom to head of the layout default helps me