Home Reference Source
public class | source

MouseSensor

Extends:

* → MouseSensor

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

Constructor Summary

Public Constructor
public

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

MouseSensor constructor.

Member Summary

Public Members
public
public
public

Mouse down timer which will end up triggering the drag start operation

public
public
Private Members
private

pageX: *

Save pageX coordinates for delay drag

private

pageY: *

Save pageY coordinates for delay drag

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

Context menu handler

private

[onDistanceChange](event: Event)

Detect change in distance, starting drag when both delay and distance requirements are met

private

[onMouseDown](event: Event)

Mouse down handler

private

[onMouseMove](event: Event)

Mouse move handler

private

[onMouseUp](event: Event)

Mouse up handler

private

Start the drag

Public Constructors

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

MouseSensor constructor.

Params:

NameTypeAttributeDescription
containers HTMLElement[] | NodeList | HTMLElement

Containers

options Object

Options

Public Members

public currentContainer: * source

public dragging: * source

public mouseDownTimeout: Number source

Mouse down timer which will end up triggering the drag start operation

Properties:

NameTypeAttributeDescription
mouseDownTimeout *

public onMouseDownAt: * source

public startEvent: * source

Private Members

private pageX: * source

Save pageX coordinates for delay drag

Properties:

NameTypeAttributeDescription
pageX Numbre

private pageY: * source

Save pageY coordinates for delay drag

Properties:

NameTypeAttributeDescription
pageY Numbre

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 [onContextMenuWhileDragging](event: Event) source

Context menu handler

Params:

NameTypeAttributeDescription
event Event

Context menu event

private [onDistanceChange](event: Event) source

Detect change in distance, starting drag when both delay and distance requirements are met

Params:

NameTypeAttributeDescription
event Event

Mouse move event

private [onMouseDown](event: Event) source

Mouse down handler

Params:

NameTypeAttributeDescription
event Event

Mouse down event

private [onMouseMove](event: Event) source

Mouse move handler

Params:

NameTypeAttributeDescription
event Event

Mouse move event

private [onMouseUp](event: Event) source

Mouse up handler

Params:

NameTypeAttributeDescription
event Event

Mouse up event

private [startDrag]() source

Start the drag