Constructor

DraggedConnectionManager

new DraggedConnectionManager(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.

Methods

applyConnections

applyConnections()

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

dispose

dispose()

Sever all links from this object.

update

update(dxy, deleteArea)

Update highlighted connections based on the most recent move location.

Parameter

dxy

goog.math.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.

wouldConnectBlock

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

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.