Home Reference Source
public class | source

Sensor

Base sensor class. Extend from this class to create a new or custom sensor

Constructor Summary

Public Constructor
public

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

Sensor constructor.

Member Summary

Public Members
public

containers: HTMLElement[]

Current containers

public

currentContainer: HTMLElement

Current container

public

Current drag state

public
public

Current options

Method Summary

Public Methods
public

Attaches sensors event listeners to the DOM

public

Detaches sensors event listeners to the DOM

public

trigger(element: HTMLElement, sensorEvent: SensorEvent): *

Triggers event on target element

Public Constructors

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

Sensor constructor.

Params:

NameTypeAttributeDescription
containers HTMLElement[] | NodeList | HTMLElement

Containers

options Object

Options

Public Members

public containers: HTMLElement[] source

Current containers

Properties:

NameTypeAttributeDescription
containers *

public currentContainer: HTMLElement source

Current container

Properties:

NameTypeAttributeDescription
currentContainer *

public dragging: Boolean source

Current drag state

Properties:

NameTypeAttributeDescription
dragging *

public lastEvent: * source

public options: Object source

Current options

Properties:

NameTypeAttributeDescription
options *

Public Methods

public attach(): Sensor source

Attaches sensors event listeners to the DOM

Return:

Sensor

public detach(): Sensor source

Detaches sensors event listeners to the DOM

Return:

Sensor

public trigger(element: HTMLElement, sensorEvent: SensorEvent): * source

Triggers event on target element

Params:

NameTypeAttributeDescription
element HTMLElement

Element to trigger event on

sensorEvent SensorEvent

Sensor event to trigger

Return:

*