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;
                }
	}
}

Register

You will be emailed a link to set your password.

Login

Lost password?