API/libsapojs/SAPO/Component/Contextmenu

Version 2 (modified by tiago.c.rodrigues, 3 years ago)

here be robots

[Elements] are optional

Class SAPO.Component.Contextmenu


class SAPO.Component.Contextmenu

requires SAPO.Dom.Event

requires SAPO.Dom.Element

requires SAPO.Utility.Variable

requires SAPO.Utility.Dimensions

Adds a context menu to a given element

Defined in Component/Contextmenu/1.1/lib.js

Constructor Summary
Contextmenu (string|DOMElement element, [Object options])
Creates a context menu for a given element

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
  • [ DOMElement|string template ] - context menu DOM element or id
  • [ Array text ] - context menu text items
  • [ Array action ] - context menu actions
  • [ string button ] - mouse button which triggers the menu (left or right)
  • [ DOMElement|elementID menuElement ] - element inside the template where the menu should be rendered. Defaults to options.template
  • [ 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
  • [ Array position ] - menu position
  • [ string wherePosition ] - source of position, which can be either "mouse" or "element"
  • [ string attributeVar ] - attribute that you can use to set a var to use in actions (great feature ;-] )
  • [ string valueVar ] - value of above attributeVar
  • [ boolean hasIframe ] - defines if the iframe hack should be used