Module: alfresco/node/DraggableNodeMixin

alfresco/node/DraggableNodeMixin

This module provides a set of attributes that define topic names for publications and subscriptions. This should be mixed into any widget that wishes to use those topics to ensure consistency. It also allows the actual values to be managed from a single file.
Author:
  • Dave Draper
License:
Source:

Members

draggableNode :element

The DOM node to be dragged. If this is left as null then the "domNode" attribute will be used (assuming there is one).
Type:
  • element
Source:

isDraggable :boolean

Indicates whether or not the mixing module should take advantage of the capabilities. This makes it possible to "opt-out" through configuration or extension.
Type:
  • boolean
Since:
  • 1.0.39
Default Value:
  • false
Source:

moveable :object

This will be assigned a reference to the "dojo/dnd/Moveable" instance created by the postCreate function
Type:
  • object
Source:

mover :object

This will be assigned a "dojo/dnd/Mover" instance when a drag is in-flight. It will be assigned in the call to onDragStart as this is the first time that a reference to the object is made available. A new "mover" is created on each move. The reference is required to work around an unresolved bug in the Dojo DND code that causes the 2nd move event to allow "click" events to bubble. If the dragged DOM node is wrapped in an anchor element then this will cause the link to be processed.
Type:
  • object
Source:

origX :number

Type:
  • number
Default Value:
  • 0
Source:

origY :number

Type:
  • number
Default Value:
  • 0
Source:

Methods

onDragEnd()

Returns the dragged node to its starting position if it hasn't been dropped onto a valid target.
Source:

onDraggableClick(e)

Suppresses click events at the end of a drag.
Parameters:
Name Type Description
e object The click event
Source:

onDragStart(mover, evt)

Captures the start of a new drag and sets the dragInFlight flag to indicate that a drag has begun and sets the mover attribute with the newly created dojo/dnd/Mover instance.
Parameters:
Name Type Description
mover object The newly created dojo/dnd/Mover instance
evt object The event created.
Source:

onMouseUp(e)

This function is called on any mouseup events that occur on the dragged node. This is required because on the 2nd drag of any node the events are fired in the wrong order (this is a bug in Dojo 1.9.0 that should be periodically checked for a fix) and would result in a click event not being suppressed (this would allow links to be processed at the end of the drag). If [mover]{@link module:alfresco/node/DraggableNodeMixin#mover} as been assigned then this has been called at the end of a drag. Therefore we can call the "onMouseUp" function of the mover to get events processing correctly again.
Parameters:
Name Type Description
e object The mouse up event
Source:

postCreate()

Source:

resetDraggableNodeStyle()

Source: