Namespace: ContextMenu

Property

currentBlock

static

Blockly.Block

Which block is the context menu attached to?

Methods

callbackFactory

static

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

Blockly.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

package   static

commentDeleteOption(comment) returns Object

Make a context menu option for deleting the current workspace comment.

Parameter

comment

Blockly.WorkspaceCommentSvg

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

package   static

commentDuplicateOption(comment) returns Object

Make a context menu option for duplicating the current workspace comment.

Parameter

comment

Blockly.WorkspaceCommentSvg

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

static

dispose()

Dispose of the menu.

hide

static

hide()

Hide the context menu.

show

static

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

package   static

workspaceCommentOption(ws, e) returns Object

Make a context menu option for adding a comment on the workspace.

Parameter

ws

Blockly.WorkspaceSvg

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.