Options
All
  • Public
  • Public/Protected
  • All
Menu

A UI utility to make an element draggable.

param app

The Application that is being made draggable.

param element

A JQuery reference to the Application's outer-most element.

param handle

The element that acts as a drag handle. Supply false to disable dragging.

param resizable

Is the application resizable? Supply an object to configure resizing behaviour or true to have it automatically configured.

param [resizable.selector]

A selector for the resize handle.

param [resizable.resizeX=true]

Enable resizing in the X direction.

param [resizable.resizeY=true]

Enable resizing in the Y direction.

param [resizable.rtl]

Modify the resizing direction to be right-to-left.

Hierarchy

  • Draggable

Index

Constructors

  • new Draggable(app: any, element: any, handle: any, resizable: any): Draggable
  • Parameters

    • app: any
    • element: any
    • handle: any
    • resizable: any

    Returns Draggable

Properties

app: any
element: any
handle: any
resizable: any
position: any

Duplicate the application's starting position to track differences

handlers: any

Remember event handlers associated with this Draggable class so they may be later unregistered

_moveTime: number

Throttle mousemove event handling to 60fps

_initial: { x: any; y: any } | { x: any; y: any }

Methods

  • activateListeners(): void
  • Activate event handling for a Draggable application Attach handlers for floating, dragging, and resizing

    Returns void

  • _activateDragListeners(): void
  • Attach handlers for dragging and floating.

    Returns void

  • _activateResizeListeners(): void
  • Attach handlers for resizing.

    Returns void

  • _onDragMouseDown(event: any): void
  • Handle the initial mouse click which activates dragging behavior for the application

    Parameters

    • event: any

    Returns void

  • _onDragMouseMove(event: any): void
  • Move the window with the mouse, bounding the movement to ensure the window stays within bounds of the viewport

    Parameters

    • event: any

    Returns void

  • _onDragMouseUp(event: any): void
  • Conclude the dragging behavior when the mouse is release, setting the final position and removing listeners

    Parameters

    • event: any

    Returns void

  • _onResizeMouseDown(event: any): void
  • Handle the initial mouse click which activates dragging behavior for the application

    Parameters

    • event: any

    Returns void

  • _onResizeMouseMove(event: any): void
  • Move the window with the mouse, bounding the movement to ensure the window stays within bounds of the viewport

    Parameters

    • event: any

    Returns void

  • _onResizeMouseUp(event: any): void
  • Conclude the dragging behavior when the mouse is release, setting the final position and removing listeners

    Parameters

    • event: any

    Returns void