Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PointerMoveTracker

Track mouse/touch events for a given element.

Hierarchy

  • PointerMoveTracker

Index

Constructors

  • new PointerMoveTracker(domNode: Element, __namedParameters: PointerMoveTrackerOptions): PointerMoveTracker
  • onMove is the callback that will be called on every mouse move. onMoveEnd is called on mouse up when movement has ended.

    Parameters

    • domNode: Element
    • __namedParameters: PointerMoveTrackerOptions

    Returns PointerMoveTracker

Properties

animationFrameID: any = null
deltaX: number = 0
deltaY: number = 0
domNode: Element
eventMoveToken: any = null
eventUpToken: any = null
isDragStatus: boolean = false
moveEvent: any = null
onMove: any = null
onMoveEnd: any = null
useTouchEvent: boolean = true
x: number = 0
y: number = 0

Methods

  • captureMoves(event: any): void
  • This is to set up the listeners for listening to mouse move and mouse up signaling the movement has ended. Please note that these listeners are added at the document.body level. It takes in an event in order to grab inital state.

    Parameters

    • event: any

    Returns void

  • didDragMove(): void
  • Returns void

  • getClientX(event: TouchEvent | MouseEvent): number
  • Parameters

    • event: TouchEvent | MouseEvent

    Returns number

  • getClientY(event: TouchEvent | MouseEvent): number
  • Parameters

    • event: TouchEvent | MouseEvent

    Returns number

  • isDragging(): boolean
  • Returns whether or not if the mouse movement is being tracked.

    Returns boolean

  • isSupportTouchEvent(): boolean
  • Returns boolean

  • onDragMove(event: TouchEvent | MouseEvent): void
  • Calls onMove passed into constructor and updates internal state.

    Parameters

    • event: TouchEvent | MouseEvent

    Returns void

  • onDragUp(event: any): void
  • Calls onMoveEnd passed into constructor and updates internal state.

    Parameters

    • event: any

    Returns void

  • releaseMoves(): void
  • These releases all of the listeners on document.body.

    Returns void

Generated using TypeDoc