Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Re: Collapse mobile menu parent click

Home Forums Older releases 0.9.x Collapse mobile menu parent click Re: Collapse mobile menu parent click

#1663
admin
Keymaster

Actually, the standard SmartMenus behavior is to expand the sub menu on first click (or tap) on the parent item and to activate the item link on second click. But for the Bootstrap add-on we have copied Bootstrap’s default behavior which is to just expand/collapse the sub menus and never activate the parent item link (it’s only possible via the context menu).

But anyway, to get the default SmartMenus behavior you will need to edit “jquery.smartmenus.bootstrap.js” and delete/comment out the following code:

,
// click the parent item to toggle the sub menus (and reset deeper levels and other branches on click)
'click.smapi': function(e, item) {
	var obj = $(this).data('smartmenus');
	if (obj.isCollapsible()) {
                var $item = $(item),
                	$sub = $item.parent().dataSM('sub');
                if ($sub && $sub.dataSM('shown-before') && $sub.is(':visible')) {
                	obj.itemActivate($item);
                	obj.menuHide($sub);
                	return false;
                }
	}
}