Blockly. ContextMenu
Property
currentBlock
Which block is the context menu attached to?
Methods
callbackFactory
callbackFactory(block, xml) returns function()
Create a callback function that creates and configures a block, then places the new block next to the original.
Parameter |
|
---|---|
block |
Original block. Value must not be null. |
xml |
Element XML representation of new block. Value must not be null. |
- Returns
-
non-null function()
Function that creates a block.
commentDeleteOption
commentDeleteOption(comment) returns Object
Make a context menu option for deleting the current workspace comment.
Parameter |
|
---|---|
comment |
The workspace comment where the right-click originated. Value must not be null. |
- Returns
-
non-null Object
A menu option, containing text, enabled, and a callback.
commentDuplicateOption
commentDuplicateOption(comment) returns Object
Make a context menu option for duplicating the current workspace comment.
Parameter |
|
---|---|
comment |
The workspace comment where the right-click originated. Value must not be null. |
- Returns
-
non-null Object
A menu option, containing text, enabled, and a callback.
dispose
dispose()
Dispose of the menu.
hide
hide()
Hide the context menu.
show
show(e, options, rtl)
Construct the menu based on the list of options and show the menu.
Parameter |
|
---|---|
e |
Event Mouse event. Value must not be null. |
options |
Array of non-null Object Array of menu options. Value must not be null. |
rtl |
boolean True if RTL, false if LTR. |
workspaceCommentOption
workspaceCommentOption(ws, e) returns Object
Make a context menu option for adding a comment on the workspace.
Parameter |
|
---|---|
ws |
The workspace where the right-click originated. Value must not be null. |
e |
Event The right-click mouse event. Value must not be null. |
- Returns
-
non-null Object
A menu option, containing text, enabled, and a callback.