listen
static listen = e
DragAndDrop.listen
controls all movements iterating through dragList
. Theoretically, it can move many objects at the same time as long as they are in dragList
.
To drop all objects without end drop functions, you can DragAndDrop.wipe()
, but better don't do it.
To enable dragging on a page you have to specify drag listener.
Example:
window.addEventListener("mousemove", DragAndDrop.listen);
That's all. There should exist only one global drag listener. It can be any object, but remember, that all drag events will be possible only inside of this object, so window
is the best option.
This function also executes realtime drag functions for currentTarget
and target
Object every move. This functions are stored in dragList
, that you can get with a function.