Interface: IDragStrategy
Defined in: packages/blockly/core/interfaces/i_draggable.ts:30
Extended by
Methods index
| Method | Description |
|---|---|
| isMovable | Returns true iff the element is currently movable. |
| startDrag | Handles any drag startup (e.g moving elements to the front of the workspace). |
| drag | Handles moving elements to the new location, and updating any visuals based on that (e.g connection previews for blocks). |
| endDrag | Handles any drag cleanup, including e.g. connecting or deleting blocks. |
| revertDrag | Moves the draggable back to where it was at the start of the drag. |
Methods
isMovable()
isMovable(): boolean;
Defined in: packages/blockly/core/interfaces/i_draggable.ts:32
Returns true iff the element is currently movable.
Returns
boolean
startDrag()
startDrag(e?): IDraggable;
Defined in: packages/blockly/core/interfaces/i_draggable.ts:42
Handles any drag startup (e.g moving elements to the front of the workspace).
Parameters
| Parameter | Type | Description |
|---|---|---|
e? | PointerEvent | KeyboardEvent | Event that started the drag; can be used to check modifier keys, etc. May be missing when dragging is triggered programmatically rather than by user. |
Returns
drag()
drag(newLoc, e?): void;
Defined in: packages/blockly/core/interfaces/i_draggable.ts:53
Handles moving elements to the new location, and updating any visuals based on that (e.g connection previews for blocks).
Parameters
| Parameter | Type | Description |
|---|---|---|
newLoc | Coordinate | Workspace coordinate to which the draggable has been dragged. |
e? | PointerEvent | KeyboardEvent | Event that continued the drag. Can be used to check modifier keys, etc. |
Returns
void
endDrag()
endDrag(e, disposition): void;
Defined in: packages/blockly/core/interfaces/i_draggable.ts:63
Handles any drag cleanup, including e.g. connecting or deleting blocks.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | PointerEvent | KeyboardEvent | undefined | Event that finished the drag. Can be used to check modifier keys, etc. |
disposition | DragDisposition | The end result of the drag. |
Returns
void
revertDrag()
revertDrag(): void;
Defined in: packages/blockly/core/interfaces/i_draggable.ts:69
Moves the draggable back to where it was at the start of the drag.
Returns
void