Skip to main content

Class: BubbleDragStrategy

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:13

Implements​

Methods index​

MethodDescription
isMovableReturns true iff the element is currently movable.
startDragHandles any drag startup (e.g moving elements to the front of the workspace).
dragHandles moving elements to the new location, and updating any visuals based on that (e.g connection previews for blocks).
endDragHandles any drag cleanup, including e.g. connecting or deleting blocks.
revertDragMoves the draggable back to where it was at the start of the drag.

Constructors​

Constructor​

new BubbleDragStrategy(bubble, workspace): BubbleDragStrategy;

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:16

Parameters​

ParameterType
bubbleIBubble
workspaceWorkspaceSvg

Returns​

BubbleDragStrategy

Methods​

isMovable()​

isMovable(): boolean;

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:21

Returns true iff the element is currently movable.

Returns​

boolean

Implementation of​

IDragStrategy.isMovable


startDrag()​

startDrag(): IBubble;

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:25

Handles any drag startup (e.g moving elements to the front of the workspace).

Returns​

IBubble

Implementation of​

IDragStrategy.startDrag


drag()​

drag(newLoc): void;

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:36

Handles moving elements to the new location, and updating any visuals based on that (e.g connection previews for blocks).

Parameters​

ParameterTypeDescription
newLocCoordinateWorkspace coordinate to which the draggable has been dragged.

Returns​

void

Implementation of​

IDragStrategy.drag


endDrag()​

endDrag(): void;

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:40

Handles any drag cleanup, including e.g. connecting or deleting blocks.

Returns​

void

Implementation of​

IDragStrategy.endDrag


revertDrag()​

revertDrag(): void;

Defined in: packages/blockly/core/dragging/bubble_drag_strategy.ts:49

Moves the draggable back to where it was at the start of the drag.

Returns​

void

Implementation of​

IDragStrategy.revertDrag