new SubMenu(anchor)
Parameters:
Name | Type | Description |
---|---|---|
anchor |
Submenu | The item in the parent menu triggering this submenu. |
- Source:
Extends
Members
className
- Inherited From:
- Source:
role
- Inherited From:
- Source:
Methods
(static) parse(json, anchor) → {SubMenu}
Parses a JSON respresentation of a variable pool.
Parameters:
Name | Type | Description |
---|---|---|
json |
JSON | The JSON object to parse. |
anchor |
Submenu | The anchor item the submenu is attached to. |
- Source:
Returns:
The new submenu object.
- Type
- SubMenu
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:
display()
- Source:
down(event)
Navigation on downwards arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- 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:
find(id) → (nullable) {Item}
Retrieves a menu item via its id by depth-first search.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The item id. |
- Inherited From:
- Implements:
- Source:
Returns:
The item if it exists.
- Type
- Item
focus()
- Inherited From:
- Source:
generateHtml()
Forces generation of the actual DOM element.
- Inherited From:
- Implements:
- Source:
generateMenu()
Generates the HTML element containing the menu entries.
- Inherited From:
- Implements:
- Source:
getAnchor() → {Submenu}
- Source:
Returns:
The submenu item that anchors this popdown submenu to
its parent.
- Type
- Submenu
getFocused() → {Item}
Returns the currently focused Item.
- Inherited From:
- Implements:
- Source:
Returns:
The focused Item.
- Type
- Item
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
getItems() → {Array.<Item>}
Returns the items in that menu.
- Inherited From:
- Implements:
- Source:
Returns:
The array of items.
- Type
- Array.<Item>
getPool() → {VariablePool.<(string|boolean)>}
- Inherited From:
- Implements:
- Source:
Returns:
The variable pool associated to
this menu.
- Type
- VariablePool.<(string|boolean)>
isPosted() → {boolean}
- Inherited From:
- Implements:
- Source:
Returns:
True if element is posted in the page.
- 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:
parseItem(items)
Parses items in JSON formats and attaches them to the menu.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<JSON> | List of JSON menu items. |
- Inherited From:
- Source:
Returns:
parseItems(items)
Parses items in JSON formats and attaches them to the menu.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<JSON> | List of JSON menu items. |
- Inherited From:
- Source:
post(xnullable, ynullable)
Posts the element at the given coordinates.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x |
number |
<nullable> |
The x coordinate. |
y |
number |
<nullable> |
The y coordinate. |
- Overrides:
- Implements:
- Source:
right(event)
Navigation on right arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source:
setBaseMenu()
Computes the topmost menu this submenu belongs to.
- Source:
setFocused(item)
Sets the currently focused Item.
Parameters:
Name | Type | Description |
---|---|---|
item |
Item | The new focused Item. |
- Inherited From:
- Implements:
- Source:
setHtml(element)
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | Sets the HTML Element. |
- 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:
unpost()
Removes element from page.
- Inherited From:
- Implements:
- Source:
unpostSubmenus()
Unposts all submenus of this menu.
- Inherited From:
- Implements:
- Source:
up(event)
Navigation on upwards arrow key pressed.
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event that fired. |
- Inherited From:
- Implements:
- Source: