Description

This module makes childNodes of some DOM Element draggable using native HTML5 drag and drop.

Details

Classes


new Dragging( idAttribute, container, onElementRender, onDragEndCallback )

Members


<private, static> dragSrcEl

Description

get the element that is being actively dragged

Details

<private, static> dragSrcEl

Description

set the element that is being actively dragged

Details

Methods


<private, static> notifyParent()

Description

Tell the initiating module that element order has changed as a result of dnd. This method has some added latency to make sure the DOM nodes have updated before this event fires.

Details

<private, static> addDnDHandlers( elem )

Description

Attach drag and drop events to some element

Parameters
Name Type Description
elem Element

DOM element to which we attach event handlers

Details

<private, static> handleDrop( e )

Description

The drop event is fired when an element or text selection is dropped on a valid drop target.

When this event occurs we want to moved the dragged element to new DOM location

Parameters
Name Type Description
e Object

drop event

Details

<private, static> handleDragStart( e )

Description

The dragstart event is fired when the user starts dragging an element or text selection.

Parameters
Name Type Description
e Object

dragStart event

Details

<private, static> handleDragOver( e )

Description

The dragover event is fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds). The event is fired on the drop target(s).

Parameters
Name Type Description
e Object

dragover event

Details

<private, static> handleDragLeave( e )

Description

The dragleave event is fired when a dragged element or text selection leaves a valid drop target.

Parameters
Name Type Description
e Object

dragLeave event

Details

<private, static> handleDragEnd( e )

Description

The dragend event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key).

Parameters
Name Type Description
e Object

dragEnd event

Details

<private, static> isBefore( a, b )

Description

Test if some node exists before another in the DOM tree

Parameters
Name Type Description
a Element

DOM Element

b Element

DOM Element

Returns
  • true if a exists before b
Details

<private, static> removeClasses( el )

Description

Remove classes that indicate active dragging

Parameters
Name Type Description
el Element

DOM node for which classes will be removed

Details