Blockly. Menu
Constructor
Menu
new Menu()
A basic menu class.
Property
openingCoords
nullable Blockly.utils.Coordinate
Coordinates of the mousedown event that caused this menu to open. Used to prevent the consequent mouseup event due to a simple click from activating a menu item immediately.
Methods
addChild
addChild(menuItem)
Add a new menu item to the bottom of this menu.
Parameter |
|
---|---|
menuItem |
Menu item to append. Value must not be null. |
dispose
dispose()
Dispose of this menu.
focus
focus()
Focus the menu element.
getElement
getElement() returns Element
Gets the menu's element.
- Returns
-
Element
The DOM element.
getSize
getSize() returns Blockly.utils.Size
Get the size of a rendered menu.
- Returns
-
non-null Blockly.utils.Size
Object with width and height properties.
highlightNext
highlightNext()
Highlights the next highlightable item (or the first if nothing is currently highlighted).
highlightPrevious
highlightPrevious()
Highlights the previous highlightable item (or the last if nothing is currently highlighted).
render
render(container)
Creates the menu DOM.
Parameter |
|
---|---|
container |
Element Element upon which to append this menu. Value must not be null. |
setHighlighted
setHighlighted(item)
Highlights the given menu item, or clears highlighting if null.
Parameter |
|
---|---|
item |
Item to highlight, or null. |
setRole
setRole(roleName)
Set the menu accessibility role.
Parameter |
|
---|---|
roleName |
role name. Value must not be null. |