Skip to main content

Home > blockly > dragging > Dragger

dragging.Dragger class

Signature:

export declare class Dragger implements IDragger 

Implements: IDragger

Constructors

ConstructorModifiersDescription
(constructor)(draggable, workspace)Constructs a new instance of the Dragger class

Properties

PropertyModifiersTypeDescription
draggableprotectedIDraggable
dragTargetprotectedIDragTarget | null
startLocprotectedCoordinate
workspaceprotectedWorkspaceSvg

Methods

MethodModifiersDescription
onDrag(e, totalDelta)Handles calculating where the element should actually be moved to.
onDragEnd(e)Handles any drag cleanup.
onDragStart(e)Handles any drag startup.
pixelsToWorkspaceUnits(pixelCoord)protected
shouldReturnToStart(e, rootDraggable)protectedReturns true if we should return the draggable to its original location at the end of the drag.
updateDragTarget(e)protectedUpdates the drag target under the pointer (if there is one).
wouldDeleteDraggable(e, rootDraggable)protectedReturns true if we would delete the draggable if it was dropped at the current location.