[Project_owners] Overlaying Right-click Context Menu

Omar Khan mromarkhan at gmail.com
Wed Nov 10 20:38:05 EST 2004


I see someone already replied, but here is a generic solution

Add listener

document.getElementById("contentAreaContextMenu").addEventListener("popupshowing",
onPopupShow, false);

I am not sure, but if you do it the following way it might override the defaults
such as <popup id="contentAreaContextMenu" onpopupshowing=''>
I have not tested it.

Write listener function

function onPopupShow()
{
	if(gContextMenu.target.nodeName.toLowerCase() == 'a')
	{
		/* show my stuff */
	}
}

I have not test it, but see if the following also works

function onPopupShow(evt)
{
	if(evt.target.nodeName.toLowerCase() == 'a')
	{
		/* show my stuff */
	}
}

References:
XulPlanet.com
Spellbound
-- 
Peace be unto you.


More information about the Project_owners mailing list