domMenu as a widget

3 views
Skip to first unread message

Lars Nygaard

unread,
Apr 29, 2005, 7:45:53 AM4/29/05
to dom-...@googlegroups.com
Hello,

I'm trying to use domMenu to create a widget in a number of web
applications (after changing the ResolveLink function to 'eval' if type
is 'js'). My problem is that I need to reuse a complicated menu
structure a about 20 times on a page, but when I try to reuse the menu
hash, the menu starts behaving erratically (exept for the first one to
be opened).

The problem is illustrated here:
http://omilia.uio.no/omc/test.html

To get around this problem, I've created an enormous js-file with the
exact same code copied in for each menu, but it would be nice to do it
properly.



Regards,
Lars Nygaard

Dan Allen

unread,
May 17, 2005, 10:21:52 PM5/17/05
to dom-...@googlegroups.com
I'm afraid you cannot reference the same menu definition object for
two different menus. You will either have to generate the menu
definition Hash twice or you can implement a deep clone to make a copy
of the existing definition object. What you are seeing is a bleeding
of the two menus. In essence, they are acting like one menu. The
reason this happens is because I use the original Hash to store
temporary information.

Hope that makes sense.

/dan
--
Open Source Advocacy
http://www.mojavelinux.com
Reply all
Reply to author
Forward
0 new messages