new Checkbox(menu, content, variable, idopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
menu |
Menu | The context menu or sub-menu the item belongs to. | |
content |
string | The content of the menu item. | |
variable |
string | The variable that is changed. | |
id |
string |
<optional> |
Optionally the id of the menu item. |
- Source:
Extends
Members
className :HtmlClass
Class name.
Type:
- HtmlClass
- Inherited From:
- Source:
disabled :boolean
Flag indicating if element is disabled.
Type:
- boolean
- Inherited From:
- Source:
role :string
Aria role element.
Type:
- string
- Overrides:
- Source:
Methods
(static) parse(json, menu) → {Checkbox}
Parses a JSON respresentation of a checkbox item.
Parameters:
Name | Type | Description |
---|---|---|
json |
JSON | The JSON object to parse. |
menu |
Menu | The menu the item is attached to. |
- Source:
Returns:
The new checkbox object.
- Type
- Checkbox
activate()
Sets active style for item.
- Inherited From:
- Source:
addAttributes(attributes)
Adds a attributes and values to the HTML element.
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Object.<string, string> | A dictionary of attributes. |
- Inherited From:
- Source:
addEvents(element)
Adds navigation events to an HTML element.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | The HTML element for navigation. |
- Inherited From:
- Source:
bubbleKey()
Bubble this key event.
- Inherited From:
- Source:
click(event)
Navigation on mouse click events.
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | The mouse event that fired. |
- Inherited From:
- Implements:
- Source:
deactivate()
Removes active style from item.
- Inherited From:
- Source:
disable()
Disable item by greying it out.
- Inherited From:
- Implements:
- Source:
down(event)
Navigation on downwards arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
enable()
Enable item.
- Inherited From:
- Implements:
- Source:
escape(event)
Navigation on escape key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
executeAction()
Execute the item's action if it is not disabled.
- Overrides:
- Source:
executeCallbacks_()
Executes the additional callbacks registered with this menu item.
- Inherited From:
- Source:
focus()
- Inherited From:
- Source:
generateHtml()
Forces generation of the actual DOM element.
- Overrides:
- Implements:
- Source:
getContent() → {string}
- Inherited From:
- Implements:
- Source:
Returns:
The content message of this item.
- Type
- string
getHtml() → {HTMLElement}
Generates the DOM element if it does not yet exists and returns it.
- Inherited From:
- Implements:
- Source:
Returns:
The HTML element associated with this entry.
- Type
- HTMLElement
getId() → {string}
- Inherited From:
- Implements:
- Source:
Returns:
The id of this item.
- Type
- string
getMenu() → {Menu}
- Inherited From:
- Implements:
- Source:
Returns:
The context menu or sub-menu the entry belongs to.
- Type
- Menu
getType() → {string}
- Inherited From:
- Implements:
- Source:
Returns:
The type of the menu entry, used for jsonification.
- Type
- string
hide()
Hide entry in the menu.
- Inherited From:
- Implements:
- Source:
isHidden() → {boolean}
- Inherited From:
- Implements:
- Source:
Returns:
Indicates if item is hidden from display.
- Type
- boolean
keydown(event)
Navigation selection on keyboard events.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
left(event)
Navigation on left arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
mousedown(event)
Navigation selection on mouse down events.
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | The mouse event that fired. |
- Inherited From:
- Implements:
- Source:
mouseout(event)
Navigation selection on mouse out events.
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | The mouse event that fired. |
- Inherited From:
- Implements:
- Source:
mouseover(event)
Navigation selection on mouse over events.
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | The mouse event that fired. |
- Inherited From:
- Implements:
- Source:
mouseup(event)
Navigation selection on mouse up events.
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | The mouse event that fired. |
- Inherited From:
- Implements:
- Source:
press()
Pressing the menu item.
- Inherited From:
- Implements:
- Source:
register()
- Source:
registerCallback(func)
Registers a callback function.
Parameters:
Name | Type | Description |
---|---|---|
func |
function | Callback that does not take any arguments. |
- Inherited From:
- Source:
right(event)
Navigation on right arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
setHtml(element)
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | Sets the HTML Element. |
- Inherited From:
- Implements:
- Source:
setMenu(menu)
Parameters:
Name | Type | Description |
---|---|---|
menu |
Menu | Sets the menu. |
- Inherited From:
- Implements:
- Source:
show()
Show entry in the menu.
- Inherited From:
- Implements:
- Source:
space(event)
Navigation on space key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
stop(event)
Stops event propagation and bubbling.
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The keyboard event that fired. |
- Inherited From:
- Source:
unfocus()
- Inherited From:
- Source:
unregister()
- Source:
unregisterCallback(func)
Removes a callback function.
Parameters:
Name | Type | Description |
---|---|---|
func |
function | Callback that does not take any arguments. |
- Inherited From:
- Source:
up(event)
Navigation on upwards arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
update()
- Source: