Class: InsertionMarkerManager

Constructor

InsertionMarkerManager

new InsertionMarkerManager(block)

Class that controls updates to connections during drags. It is primarily responsible for finding the closest eligible connection and highlighting or unhiglighting it as needed during a drag.

Parameter

block

Blockly.BlockSvg

The top block in the stack being dragged.

Value must not be null.

Enumeration

PREVIEW_TYPE

static

number

An enum describing different kinds of previews the InsertionMarkerManager could display.

Value

INSERTION_MARKER

INPUT_OUTLINE

REPLACEMENT_FADE

Properties

PREVIEW_TYPE

static

number

An enum describing different kinds of previews the InsertionMarkerManager could display.

Value

INSERTION_MARKER

INPUT_OUTLINE

REPLACEMENT_FADE

localConnection_

non-null Blockly.RenderedConnection

Methods

applyConnections

package

applyConnections()

Connect to the closest connection and render the results. This should be called at the end of a drag.

dispose

package

dispose()

Sever all links from this object.

getInsertionMarkers

package

getInsertionMarkers() returns Array of non-null Blockly.BlockSvg

Get a list of the insertion markers that currently exist. Drags have 0, 1, or 2 insertion markers.

Returns

non-null Array of non-null Blockly.BlockSvg A possibly empty list of insertion marker blocks.

update

package

update(dxy, deleteArea)

Update connections based on the most recent move location.

Parameter

dxy

Blockly.utils.Coordinate

Position relative to drag start, in workspace units.

Value must not be null.

deleteArea

number

One of Blockly.DELETE_AREA_TRASH, Blockly.DELETE_AREA_TOOLBOX, or Blockly.DELETE_AREA_NONE.

Value may be null.

updateAvailableConnections

package

updateAvailableConnections()

Update the available connections for the top block. These connections can change if a block is unplugged and the stack is healed.

wouldConnectBlock

package

wouldConnectBlock() returns boolean

Return whether the block would be connected if dropped immediately, based on information from the most recent move event.

Returns

boolean True if the block would be connected if dropped immediately.

wouldDeleteBlock

package

wouldDeleteBlock() returns boolean

Return whether the block would be deleted if dropped immediately, based on information from the most recent move event.

Returns

boolean True if the block would be deleted if dropped immediately.