Skip to main content

Class: Gesture

Defined in: packages/blockly/core/gesture.ts:57

Class for one gesture.

Properties index​

PropertyDescription
startWorkspace_The workspace that the gesture started on. There may be multiple workspaces on a page; this is more accurate than using Blockly.common.getMainWorkspace().
isEnding_Boolean used internally to break a cycle in disposal.
currentDropdownOwnerThe owner of the dropdownDiv when this gesture first starts. Needed because we'll close the dropdown before fields get to act on their events, and some fields care about who owns the dropdown.

Methods index​

MethodDescription
getCurrentDraggerReturns the current dragger if the gesture is a drag.
inProgressIs a drag or other gesture currently in progress on any workspace?

Constructors​

Constructor​

new Gesture(e, creatorWorkspace): Gesture;

Defined in: packages/blockly/core/gesture.ts:184

Parameters​

ParameterTypeDescription
ePointerEventThe event that kicked off this gesture.
creatorWorkspaceWorkspaceSvgThe workspace that created this gesture and has a reference to it.

Returns​

Gesture

Properties​

startWorkspace_​

protected startWorkspace_: WorkspaceSvg | null = null;

Defined in: packages/blockly/core/gesture.ts:109

The workspace that the gesture started on. There may be multiple workspaces on a page; this is more accurate than using Blockly.common.getMainWorkspace().


isEnding_​

protected isEnding_: boolean = false;

Defined in: packages/blockly/core/gesture.ts:146

Boolean used internally to break a cycle in disposal.


currentDropdownOwner​

currentDropdownOwner: Field<any> | null = null;

Defined in: packages/blockly/core/gesture.ts:177

The owner of the dropdownDiv when this gesture first starts. Needed because we'll close the dropdown before fields get to act on their events, and some fields care about who owns the dropdown.

Methods​

getCurrentDragger()​

getCurrentDragger():
| IDragger
| WorkspaceDragger
| null;

Defined in: packages/blockly/core/gesture.ts:1120

Returns the current dragger if the gesture is a drag.

Returns​

| IDragger | WorkspaceDragger | null


inProgress()​

static inProgress(): boolean;

Defined in: packages/blockly/core/gesture.ts:1153

Is a drag or other gesture currently in progress on any workspace?

Returns​

boolean

True if gesture is occurring.