Home Reference Source
public class | source

DragSensor

Extends:

* → DragSensor

This sensor picks up native browser drag events and dictates drag operations

Constructor Summary

Public Constructor
public

constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object)

DragSensor constructor.

Member Summary

Public Members
public
public

draggableElement: HTMLElement

Draggable element needs to be remembered to unset the draggable attribute after drag operation has completed

public
public

Mouse down timer which will end up setting the draggable attribute, unless canceled

public

nativeDraggableElement: HTMLElement

Native draggable element could be links or images, their draggable state will be disabled during drag operation

Method Summary

Public Methods
public

attach()

Attaches sensors event listeners to the DOM

public

detach()

Detaches sensors event listeners to the DOM

Private Methods
private

[onDragEnd](event: Event)

Drag end handler

private

[onDragOver](event: Event)

Drag over handler

private

[onDragStart](event: Event)

Drag start handler

private

[onDrop](event: Event)

Drop handler

private

[onMouseDown](event: Event)

Mouse down handler

private

[onMouseUp](event: Event)

Mouse up handler

private

[reset](event: Event)

Mouse up handler

Public Constructors

public constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object) source

DragSensor constructor.

Params:

NameTypeAttributeDescription
containers HTMLElement[] | NodeList | HTMLElement

Containers

options Object

Options

Public Members

public currentContainer: * source

public draggableElement: HTMLElement source

Draggable element needs to be remembered to unset the draggable attribute after drag operation has completed

Properties:

NameTypeAttributeDescription
draggableElement *

public dragging: boolean source

public mouseDownTimeout: Number source

Mouse down timer which will end up setting the draggable attribute, unless canceled

Properties:

NameTypeAttributeDescription
mouseDownTimeout *

public nativeDraggableElement: HTMLElement source

Native draggable element could be links or images, their draggable state will be disabled during drag operation

Properties:

NameTypeAttributeDescription
nativeDraggableElement *

Public Methods

public attach() source

Attaches sensors event listeners to the DOM

public detach() source

Detaches sensors event listeners to the DOM

Private Methods

private [onDragEnd](event: Event) source

Drag end handler

Params:

NameTypeAttributeDescription
event Event

Drag end event

private [onDragOver](event: Event) source

Drag over handler

Params:

NameTypeAttributeDescription
event Event

Drag over event

private [onDragStart](event: Event) source

Drag start handler

Params:

NameTypeAttributeDescription
event Event

Drag start event

private [onDrop](event: Event) source

Drop handler

Params:

NameTypeAttributeDescription
event Event

Drop event

private [onMouseDown](event: Event) source

Mouse down handler

Params:

NameTypeAttributeDescription
event Event

Mouse down event

private [onMouseUp](event: Event) source

Mouse up handler

Params:

NameTypeAttributeDescription
event Event

Mouse up event

private [reset](event: Event) source

Mouse up handler

Params:

NameTypeAttributeDescription
event Event

Mouse up event