Page 2 of 2

Re: clearMenuState

Posted: 22 Feb 2017, 16:55
by spadovan
Hi Aragorn...it's still me.

I've putted this code in the page wjere i like to clear menu:

Code: Select all

		<script>
			$( document ).ready(function() {
				PF('sidebar-menu').clearMenuState();
				PF('sidebar-menu').clearActiveItems();
			});
		</script>
When i enter in this page the menu is cleared but the cookie is valorized whith the current menu item selected, so if then i click on another menu item, it will highlight both of them...

Thanks

Re: clearMenuState

Posted: 22 Feb 2017, 16:57
by spadovan
BTW i'm currently using ultima layout....not omega

Re: clearMenuState

Posted: 02 Mar 2017, 10:46
by spadovan
I resolved modifying the code of the clearActiveItems function, adding

this.expandedMenuitems = [];

Code: Select all

	clearActiveItems: function () {
		var activeItems = this.jq.find('li.active-menuitem');
		subContainers = activeItems.children('ul');

		activeItems.removeClass('active-menuitem');
		if (subContainers && subContainers.length) {
			subContainers.hide();
		}
[b]		this.expandedMenuitems = [];[/b]
	},

Re: clearMenuState

Posted: 07 Mar 2017, 15:43
by mert.sincan
Good solution, thanks alot for the update!