Methods
-
<static> attach(options)
-
Register dragging on an element
options: { element : «Element» see hui.drag.start for more options }Parameters:
Name Type Description optionsObject The options
Properties
Name Type Description elementElement The element to attach to
-
<static> listen(options)
-
Listen for native drops
options: { elements : «Element», hoverClass : «String», $drop : function(event), $dropFiles : function(fileArray), $dropURL : function(url), $dropText : function(url) }Parameters:
Name Type Description optionsObject The options
-
<static> start(options)
-
Start dragging
options: { onBeforeMove ($firstMove) : function(event), // Called when the cursor moves for the first time onMove ($move): function(event), // Called when the cursor moves onAfterMove ($didMove): function(event), // Called if the cursor has moved onNotMoved ($notMoved): function(event), // Called if the cursor has not moved onEnd ($finally) : function(event), // Called when the mouse is released, even if the cursor has not moved }Parameters:
Name Type Description optionsObject The options
Properties
Name Type Description $beforefunction When the user starts interacting (mousedown/touchstart)
$startMovefunction When the user starts moving (before first move - called once)
$movefunction When the user moves
$endMovefunction After a move has finished
$notMovedfunction If the user started interacting but did not move (maybe treat as click/tap)
$finallyfunction After everything - moved or not