DragContext

This class is created during drag operations of Draggable. It holds the state of an ongoing drag operation.

Configs

3
itemElement: HTMLElement

The element that will have the draggingItemCls. This element is determined by the dragItemSelector.

threshold: Number= 5

The minimum distance from the touchstart/mousedown/pointerdown that must be moved to actually start a drag operation.

touchStartDelay: Number= 300

The minimum amount of time a touch must be maintained before it will initiate a drag. Movement prior to this time will cancel the drag in order to allow touch scrolling.

Properties

19

Class hierarchy

isDragContext: Boolean= truereadonly
Identifies an object as an instance of DragContext class, or subclass thereof.
isDragContext: Boolean= truereadonlystatic
Identifies an object as an instance of DragContext class, or subclass thereof.

Other

aborted: Booleanreadonly

This property is true if the abort method was called and false otherwise. This is typically because the user pressed the ESC key, however, a drag can be aborted for other reasons.

altKey: Boolean

This property holds the altKey state of the most recent event.

completed: Booleanreadonly

Returns true if the drag has completed either by mouse/pointerup or the abort method.

ctrlKey: Boolean

This property holds the ctrlKey state of the most recent event.

element: HTMLElementreadonly

The element from which the drag operation started.

endEvent: Eventreadonly

The event that completed the drag (a mouseup, pointerup or touchend).

event: Eventreadonly

The current DOM event being processed.

metaKey: Boolean

This property holds the metaKey state of the most recent event.

pending: Booleanreadonly

This property is true if the drag threshold has not yet been reached.

shiftKey: Boolean

This property holds the shiftKey state of the most recent event.

started: Booleanreadonly

This property is true if the drag threshold has been reached and the drag operation is active.

startEvent: Eventreadonly

The event that started the drag operation.

valid: Boolean

This property is true when the drag is in a valid drop state. This can be set to false to indicate the drop is invalid. Setting to true does not ensure that the property will be true when next read due to other factors that are required to make the drop valid. For example, setting valid = true will still return false if called before the drag threshold has not been reached or if the abort method has been called.

Lifecycle

configBase

Functions

19

Other

Aborts the drag. After calling this method, aborted will be true, valid will be false and completed will be true.

Retrieves a data item from the drag source. This method can only be called after the drag has completed.

ParameterTypeDescription
nameString | String[]

The name of the data item.

Returns: *

Returns true if the named data item is present.

ParameterTypeDescription
nameString

The name of the data item.

Returns: Boolean

Retrieves a data item from the drag source if it is available. This will return true for an item that was set using a renderer function.

ParameterTypeDescription
nameString | String[]

The name of the data item.

Returns: *

Sets a data item for the drag. If a function is passed, it is called to render the data only if that data is actually requested via the get method. A data renderer function can be async.

ParameterTypeDescription
nameString

The name of the data item.

value*

The value of the data item.

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase