Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Draggable

Hierarchy

Implements

Index

Constructors

constructor

  • new Draggable(element: HTMLElement, dragHandle?: HTMLElement): Draggable
  • Creates a Draggable object for moving the given element when you start dragging the dragHandle element (equals the element itself by default).

    Parameters

    • element: HTMLElement
    • Optional dragHandle: HTMLElement

    Returns Draggable

Methods

addEventListener

  • addEventListener(type: string, fn: function, context?: any): Draggable
  • addEventListener(eventMap: any, context?: any): Draggable

addOneTimeEventListener

  • addOneTimeEventListener(type: string, fn: function, context?: any): Draggable
  • Parameters

    Returns Draggable

clearAllEventListeners

disable

  • disable(): void
  • Disables the dragging ability.

    Returns void

enable

  • enable(): void
  • Enables the dragging ability.

    Returns void

fire

  • Parameters

    • type: string
    • Optional data: any

    Returns Draggable

fireEvent

  • fireEvent(type: string, data?: any): Draggable

hasEventListeners

  • hasEventListeners(type: string): boolean

off

  • off(type: string, fn?: function, context?: any): Draggable
  • off(eventMap?: any, context?: any): Draggable
  • Parameters

    • type: string
    • Optional fn: function
    • Optional context: any

    Returns Draggable

  • Parameters

    • Optional eventMap: any
    • Optional context: any

    Returns Draggable

on

  • on(type: string, fn: function, context?: any): Draggable
  • on(eventMap: any, context?: any): Draggable
  • Parameters

    Returns Draggable

  • Parameters

    • eventMap: any
    • Optional context: any

    Returns Draggable

once

  • once(type: string, fn: function, context?: any): Draggable
  • Parameters

    Returns Draggable

removeEventListener

  • removeEventListener(type: string, fn?: function, context?: any): Draggable
  • removeEventListener(eventMap?: any, context?: any): Draggable
  • Parameters

    • type: string
    • Optional fn: function
    • Optional context: any

    Returns Draggable

  • Parameters

    • Optional eventMap: any
    • Optional context: any

    Returns Draggable

Static addInitHook

  • addInitHook(methodName: string, ...args: any[]): void
  • You can also use the following shortcut when you just need to make one additional method call.

    Parameters

    • methodName: string
    • Rest ...args: any[]

    Returns void

Static extend

  • You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it.

    Parameters

    Returns any