drawMenus() mm_menueditapi dynamically created menu - SOLVED

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
briatx
Beginner
Beginner
Posts: 5
Joined: Thu Nov 09, 2006 12:36 am

drawMenus() mm_menueditapi dynamically created menu - SOLVED

Post by briatx »

Hi everyone,

Small problem here that I hope someone has an answer to. :)

I have a basic horizontal menu that is our basic navigation on our site.

I am working on adding a context menu, but one created dynamically with javascript using the mm_menueditapi.

The main menu created with drawMenus() works, and I have seen articles on how to do multiple menus with multiple calls to drawMenus(). That's not the problem, however.

The dynamically created mm_menueditapi works by itself, and it does pop up correctly when on the same page as the drawMenus() menu.

However, when I start to mouseover the dynamic context menu created with mm_menueditapi, then something strange happens. It appears that the menu thinks I'm also mousing over the main menu at the top that was created with drawMenus().

The main menu is named something like "mainmenu" and the other menu has a name like "Assignment Menu". The names should be different, so this should work?

Is there a way to specify that the menu created with mm_menueditapi is a 2nd "main menu" rather than linked to the first? Or does anyone know why mousing over one menu would affect another one if they are named differently?

Thanks for any help or suggestions.

brian.
briatx
Beginner
Beginner
Posts: 5
Joined: Thu Nov 09, 2006 12:36 am

Post by briatx »

Thought I might add some code to this.

Basically, I'm using a slightly modified mm_addMenu function to allow me to set the name of the created menu, instead of getting the automated menu5 or whatever. I also commented out the popup so that the menu would stay hidden until i popped it up myself.

Code: Select all

function mm_addContextMenu()
{	
	var a=arguments
	var n=_m.length;
	with(milonic=new menuname(a[3])){
		style=a[0];
		alwaysvisible=false;
		if(a[1])eval(a[1])
		_itemProps=""
		if(a[2])_itemProps=a[2]
		_bl=_mi.length
		aI("text=New Item;"+_itemProps);
	}
	mm_createNewMenus();
	//popup("newmenu"+n,1)
	return n;
}
briatx
Beginner
Beginner
Posts: 5
Joined: Thu Nov 09, 2006 12:36 am

Post by briatx »

Nevermind guys, looks like I was silly and had some milonic files included twice.

I guess that really does make a difference. :o

Ok, well note for posterity. Mouse over on one menu doing weird stuff to a second menu, check for double includes. (Any way to set up sentinels/guards in js?)
Post Reply