- Dawn -
I cannot consistently repro this bug when I run your
examples locally. The problem seems like it could be
due to the call to "stopPropagation" on line 21 of
Do you need this?
--- Dawn Endico <endico@...> wrote:
> I'm developing a menu control for my google map
> using YUI menus. The code
> worked great until I moved the code inside a
> constructor and now clicking on
> menu items in firefox doesn't work, although it does
> in safari. Firebug's
> event inspector doesn't show any click events when I
> click on a menu item so
> the menu's custom event seems to be getting fired
> but for some reason its
> not executing my callback.
> Does anyone have any suggestions on how to approach
> debugging this? The fact
> that it works in Safari but not Firefox should be a
> clue. It seems like is
> some kind of scope issue since it started after I
> wrapped the code in a
> The current app is here
> A version that works is here
> Another broken version, which is closer to the
> working code
- Thanks for looking at it. Removing the stopPropagation call from demo3
didn't help. I'm using both Firefox 1.5 and 2 on two different
machines and its broken both places.
I finally got the app working by listening to mouseUp events instead
of clicks so there's not much point in looking at this version any
more. I'd still like to debug the click problem though if possible.
What do you do to debug something like this? The event inspector
wasn't very helpful since no click events are showing up when i click
on the menu. Printing log entries hasn't been much help either. I'd
like to tell the debugger to break on a click event but I don't think
that's possible unless I already know which code would get executed
This new version has the menu control loaded outside the map (way over
in the upper right of the page) to make sure there are no map
listeners intercepting the clicks. Its also loaded with
window.console.log statements which make it look like events.js is
never seeing any click events.
The original two versions where it broke are still here
- I've discovered that the difference between a working and broken menu
is in the way I create the menu object. If I do it by hand, the menu
works, but when the map's addControl function does it then the menu
Here's another couple of tests with more debugging code.