Re: showPopup vs openPopup
"alta88[nntp]" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
---On 2008.Jun.02 05:37 PM, Neil Deakin wrote: > alta88[nntp] wrote: >> if this isn't DOM someone can correct.. >> >> i notice showPopup has been deprecated for openPopup and >> openPopupAtScreen. however, i have noticed the problem that a button >> in statusbar (i have given statusbar a contextmenu) which uses >> openPopup for its own contextmenu will result in both popups >> appearing - ie openPopup does not preventDefault() like apparently >> showPopup did. (no buttons with showPopup have this problem). >> > > Not clear what you mean here. Neither openPopup nor showPopup take an > event argument on which to call preventDefault. > > What event are you referring to? > > What are the two popups referred to by 'both popups'? in TotalToolbar, i have added a <context> attribute to <statusbar> via xul overlay, which opens the <popup> named in <context>. the <popup> has an <onpopupshowing> which runs some code to complete the popup menu. extensions add <statusbarpanel> items in the statusbar, which may have an <onclick> attribute. the onclick code either does a showPopup (old way that works) or, in this particular case, openPopupAtScreen. the onclick runs first (passing an event) and opens its popup; then, in the case of openPopup, the contextmenu for statusbar is opened and onpopupshowing code runs. so you get 2 popups at the same time, hard to detect if the second is on top, when what you want is the first, on one rt click. i'm guessing the binding methods are different for showPopup vs openPopup. i'm also guessing that if an event.preventDefault() were added immediately after the openPopup (event is passed via the onclick function), the statusbar contextmenu would not... pop up.