Module: alfresco/node/NodeDropTargetMixin

alfresco/node/NodeDropTargetMixin

This can be mixed in to any widget that represents any Alfresco container (e.g. any of the renderers, such as a Thumbnail). The addNodeDropTarget function will then allow that widget to become a valid target for widgets that have the DraggableNodeMixin mixed into them.
Author:
  • Dave Draper
License:
Source:

Members

dropTarget :element

The DOM node to listen for drop events on.
Type:
  • element
Default Value:
  • null
Source:

dropTargetEnabled :boolean

Indicates whether or not a move action is currently "in-flight". This is set by callback handlers for the events published by the Dojo DND manager.
Type:
  • boolean
Default Value:
  • false
Source:

shouldProcessDrop :boolean

Indicates whether or not the drop target is able to process a drop event that occurs. This attribute is set to true by the onMouseEnter function and set to false by the onMouseLeave function
Type:
  • boolean
Default Value:
  • false
Source:

targetNode :element

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

Methods

addNodeDropTarget()

Sets up the supplied node as a drop target.
Source:

getDropTargetNodeRefUri() → {string}

Source:
Returns:
The URI fragment representation of a NodeRef (e.g. without the double forward slash and colon)
Type
string

getDropTargetPath() → {string}

Source:
Returns:
The path to the drop target.
Type
string

onMouseEnter(evt)

Handler for the mouse entering the dropTarget element. This sets the shouldProcessDrop attribute to true so that if a drop occurs this target will process it.
Parameters:
Name Type Description
evt object
Source:

onMouseLeave(evt)

Handler for the mouse leaving the dropTarget element. This sets the shouldProcessDrop attribute to true so that if a drop occurs this target will process it.
Parameters:
Name Type Description
evt object
Source:

onMoveStarted(mover)

Handles move events starting. This sets the dropTargetEnabled attribute to true to indicate that a move is in-flight and that this target could potentially process the drop. Currently this applies to all move events but could be updated/overridden to check for more specific move targets.
Parameters:
Name Type Description
mover object The dojo/dnd/Mover object representing the moved element
Source:

onMoveStopped(mover)

Handles drop events that occur when a move completes (e.g. on a "mouseup" event to end a drag). If the drop occurred within the dropTarget element (as indicated by the shouldProcessDrop attribute) then an attempt will be made to move the node represented by the mover argument.
Parameters:
Name Type Description
mover object
Source: