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.

Reply To: Top Level Menu Item Shows/Hides Sub Menu on Click

Home Forums Older releases 1.0.x Top Level Menu Item Shows/Hides Sub Menu on Click Reply To: Top Level Menu Item Shows/Hides Sub Menu on Click

#2901
admin
Keymaster

Hi again and sorry for the long delay of this answer during the holidays!

What comes to my mind right now is to use hideOnClick: true and the following mod in addition (this should be added after “jquery.smartmenus.js” in your page source but before your main menu init code):

// SmartMenus mod - hide the menus on document click just in collapsible mode
$.SmartMenus.prototype._docClick = $.SmartMenus.prototype.docClick;
$.SmartMenus.prototype._docTouchEnd = $.SmartMenus.prototype.docTouchEnd;
$.SmartMenus.prototype.docClick = function(e) {
	if (this.isCollapsible()) {
		this._docClick(e);
	}
}
$.SmartMenus.prototype.docTouchEnd = function(e) {
	if (this.isCollapsible()) {
		this._docTouchEnd(e);
	}
}

This isn’t the most elegant solution but should work fine for now (in the future I may think of some generic way to allow using different options in mobile and desktop view).

Happy Holidays!