class
SAPO.Component.Contextmenu
Defined in
Component/Contextmenu/2.1/lib.js
Constructor Summary
Creates a context menu for a given element
Function Summary
hides the context menu
Shows the context menu
Constructor Details
constructor Contextmenu
Contextmenu(string|DOMElement
element, [Object
options])
Creates a context menu for a given element
Parameters:
element
- Element id or object
[options]
- Options for the context menu -
[ string button ]
- mouse button which triggers the menu (left or right) -
[ Array menu ]
- context menu text items -
[ Array position ]
- menu position -
[ string wherePosition ]
- source of position, which can be either "mouse" or "element" -
[ boolean hasIframe ]
- defines if the iframe hack should be used -
[ DOMElement|string template ]
- context menu DOM element or id -
[ DOMElement|elementID closeElement ]
- element which closes the menu. Defaults to options.element -
[ DOMElement|elementID closeOnBlur ]
- close context menu when the user clicks out the menu
Function Details
function hide
hide([Object
pointer], DOMElement
elm)
hides the context menu
Parameters:
[pointer]
coordinates x,y
elm
Returns:
{Boolean}
function show
show([Object
pointer], DOMElement
elm)
Shows the context menu
Parameters:
[pointer]
coordinates x,y
elm
return {Boolean}
requires SAPO.Dom.Event
Adds a context menu to a given element