Methods
-
<static> attach(options)
-
Register dragging on an element
options: { element : «Element» see hui.drag.start for more options }
Parameters:
Name Type Description options
Object The options
Properties
Name Type Description element
Element 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 options
Object 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 options
Object The options
Properties
Name Type Description $before
function When the user starts interacting (mousedown/touchstart)
$startMove
function When the user starts moving (before first move - called once)
$move
function When the user moves
$endMove
function After a move has finished
$notMoved
function If the user started interacting but did not move (maybe treat as click/tap)
$finally
function After everything - moved or not