DD Class
Provides drag and drop
functionality with dropzones
Copyright (c) 2014 ITSA - https://github.com/itsa New BSD License - http://choosealicense.com/licenses/bsd-3-clause/
Item Index
Methods
- _allowedEffects
- _defFnDrag
- _defFnDrop
- _defFnDrop (extended by drag-drop)
- _defFnOver
- _defFnStart
- _defineDDStart
- _defineDropEv
- _defineOverEv
- _emitDropzoneDrop
- _handleDrop
- _initializeDrag
- _prevFnStart
- _restoreDraggables
- _setBack
- _setupKeyEv
- _setupMouseEv
- _teardownOverEvent
- allowCopy
- allowSwitch
- getDropzoneEmitter
- init
- init (extended by drag-drop)
- notify static
- onlyCopy
- restoreDraggables
Properties
Methods
_allowedEffects
-
dragableElement
Returns the allowed effects on the dragable-HtmlElement. Is determined by the attribute dd-effect-allowed
Will be set to "move" when undefined.
Parameters:
-
dragableElement
HtmlElementHtmlElement that is checked for its allowed effects
Returns:
allowed effects: "move", "copy" or "all"
_defFnDrop (extended by drag-drop)
-
e
-
sourceNode
-
dragNode
-
dropzoneSpecified
-
relatives
Default function for the *:dd-drop
-event. Overrides the definition of the drag
-module.
Parameters:
-
e
Objecteventobject
-
sourceNode
HtmlElementthe original HtmlElement
-
dragNode
HtmlElementthe dragged HtmlElement (either original or clone)
-
dropzoneSpecified
Booleanwhether the sourceNode had a dropzone specified
-
relatives
Arrayhash with all draggables that are being move togerther with the master draggable
_defineDDStart
-
emitterName
Defines the definition of the dd
event: the first phase of the drag-eventcycle (dd, :dd-drag, :dd-drop)
Parameters:
-
emitterName
Stringthe emitterName, which leads into the definition of event
emitterName:dd
_defineDropEv
-
e
-
sourceNode
-
dragNode
-
dropzoneSpecified
-
x
-
y
-
inlineLeft
-
inlineTop
-
relatives
Defines the definition of the dd-drop
event: the last phase of the drag-eventcycle (dd-start, :dd-drag, :dd-drop)
Parameters:
-
e
Objecteventobject
-
sourceNode
HtmlElementthe original HtmlElement
-
dragNode
HtmlElementthe dragged HtmlElement (either original or clone)
-
dropzoneSpecified
Booleanwhether the sourceNode had a dropzone specified
-
x
Numberx-position in coordinaties relative to
document
(like getX()) -
y
Numbery-position in coordinaties relative to
document
(like getX()) -
inlineLeft
Stringinline css
left
for the original sourceNode -
inlineTop
Stringinline css
top
for the original sourceNode -
relatives
Arrayhash with all draggables that are being move togerther with the master draggable
_defineOverEv
-
e
-
dropzones
Defines the definition of the dropzone
event.
Also sets up listeners to tricker dd-over when the mouse is above an dropzone.
Parameters:
-
e
Objecteventobject
-
dropzones
NodeListlist with dropzonenodes
_emitDropzoneDrop
-
e
Emits a dropzone-drop event.
Parameters:
-
e
Objecteventobject to pass arround
_handleDrop
-
e
-
sourceNode
-
dragNode
-
relatives
Sets the draggable node back to its original position
_initializeDrag
-
e
Default function for the *:dd-drag
-event
Parameters:
-
e
Objecteventobject
_prevFnStart
-
e
Prevented function for the *:dd-start
-event
Parameters:
-
e
Objecteventobject
_restoreDraggables
-
e
-
sourceNode
-
dragNode
-
dropzoneSpecified
-
x
-
y
-
inlineLeft
-
inlineTop
-
relatives
Sets the draggable items back to their original place. Should only be used when you prevent the default-function of dd-drop
,
so you can choose to do set the draggables back conditionally.
Parameters:
-
e
Objecteventobject
-
sourceNode
HtmlElementthe original HtmlElement
-
dragNode
HtmlElementthe dragged HtmlElement (either original or clone)
-
dropzoneSpecified
Booleanwhether the sourceNode had a dropzone specified
-
x
Numberx-position in coordinaties relative to
document
(like getX()) -
y
Numbery-position in coordinaties relative to
document
(like getX()) -
inlineLeft
Stringinline css
left
for the original sourceNode -
inlineTop
Stringinline css
top
for the original sourceNode -
relatives
Arrayhash with all draggables that are being move togerther with the master draggable
_setBack
-
sourceNode
-
dragNode
-
dropzoneSpecified
-
x
-
y
-
inlineLeft
-
inlineTop
-
[emitDropzoneEvent]
Sets the draggable node back to its original position
Parameters:
-
sourceNode
HtmlElementthe original HtmlElement
-
dragNode
HtmlElementthe dragged HtmlElement (either original or clone)
-
dropzoneSpecified
Booleanwhether the sourceNode had a dropzone specified
-
x
Numberx-position in coordinaties relative to
document
(like getX()) -
y
Numbery-position in coordinaties relative to
document
(like getX()) -
inlineLeft
Stringinline css
left
for the original sourceNode -
inlineTop
Stringinline css
top
for the original sourceNode -
[emitDropzoneEvent]
Boolean optionalwhether dropzone-event should be emitted
_setupKeyEv
()
private
Sets up a keydown
and keyup
listener, to monitor whether a ctrlKey
(windows) or metaKey
(Mac)
is pressed to support the copying of draggable items
_setupMouseEv
()
private
Engine behind the drag-drop-cycle.
Sets up a mousedown
listener to initiate a drag-drop eventcycle. The eventcycle start whenever
one of these events happens on a HtmlElement with the attribute dd-draggable="true"
.
The drag-drop eventcycle consists of the events: dd-start
, emitterName:dd-drag
and emitterName:dd-drop
_teardownOverEvent
-
e
Cleansup the dragover subscriber and fulfills any dropzone-promise.
Parameters:
-
e
Objecteventobject
allowCopy
-
dropzone
Returns true if the dropzone-HtmlElement accepts copy-dragables.
Is determined by the attribute dd-effect-allowed="copy"
or dd-effect-allowed="all"
Parameters:
-
dropzone
HtmlElementHtmlElement that is checked for its allowed effects
Returns:
if copy-dragables are allowed
allowSwitch
-
dragableElement
Returns true if the dragable-HtmlElement allowes to switch between copy
and move
.
Parameters:
-
dragableElement
HtmlElementHtmlElement that is checked for its allowed effects
Returns:
if copy-dragables are allowed
getDropzoneEmitter
-
dropzone
Returns the emitterName that the dropzone accepts.
Parameters:
-
dropzone
Stringdropzone attribute of the dropzone HtmlElement
Returns:
the emitterName that is accepted
init
-
dragableElement
Initializes dragdrop. Needs to be invoked, otherwise DD won't run.
Parameters:
-
dragableElement
HtmlElementHtmlElement that is checked for its allowed effects
Returns:
if copy-dragables are allowed
init (extended by drag-drop)
-
dragableElement
Initializes dragdrop. Needs to be invoked, otherwise DD won't run.
Parameters:
-
dragableElement
HtmlElementHtmlElement that is checked for its allowed effects
Returns:
if copy-dragables are allowed
notify
-
callback
-
context
-
setup
Creates a notifier to response after each Drag
event is set up, or teared down.
You can use this to hook in into the drag-eventcycle: the drop
-module uses it this way.
Parameters:
Returns:
handle with a method detach()
which you can use to remove it from the notifier-hash
onlyCopy
-
dragableElement
Returns true if the dragable-HtmlElement accepts only copy-dragables (no moveable)
Is determined by the attribute dd-effect-allowed="copy"
Parameters:
-
dragableElement
HtmlElementHtmlElement that is checked for its allowed effects
Returns:
if only copy-dragables are allowed
restoreDraggables
()
private
chainable
Sets the draggable items back to their original place. Should only be used when you prevent the default-function of dd-drop
,
so you can choose to do set the draggables back conditionally.
Properties
_notifiers
Array
private
Internal hash with notifiers to response after each Drag
event is set up, or teared down.
You can use this to hook in into the drag-eventcycle: the drop
-module uses it this way.
Is filled by using notify()
.
Default: []
ddProps
Object
Objecthash containing all specific information about the particular drag-cycle. It has a structure like this:
ddProps = {
dragNode {HtmlElement} Element that is dragged
x {Number} absolute x-position of the draggable inside document
when the drag starts
y {Number} absolute y-position of the draggable inside document
when the drag starts
inlineLeft {String} inline css of the property left
when drag starts
inlineTop {String} inline css of the property top
when drag starts
winConstrained {Boolean} whether the draggable should be constrained to window
xMouseLast {Number} absolute x-position of the mouse inside document
when the drag starts
yMouseLast {Number} absolute y-position of the draggable inside document
when the drag starts
winScrollLeft {Number} the left-scroll of window when drag starts
winScrollTop {Number} the top-scroll of window when drag starts
constrain = { // constrain-properties when constrained to a HtmlElement
xOrig {Number} x-position in the document, included with left-border-width
yOrig {Number} y-position in the document, included with top-border-width
x {Number} xOrig corrected with scroll-left of the constrained node
y {Number} yOrig corrected with scroll-top of the constrained node
w {Number} scrollWidth
h {Number} scrollHeight
};
relatives[{ // Array with objects that represent all draggables that come along with the master-draggable (in case of multiple items), excluded the master draggable itself
sourceNode {HtmlElement} original node (defined by drag-drop)
dragNode {HtmlElement} draggable node
shiftX {Number} the amount of left-pixels that this HtmlElement differs from the dragged element
shiftY {Number} the amount of top-pixels that this HtmlElement differs from the dragged element
inlineLeft {String} inline css of the property left
when drag starts
inlineTop {String} inline css of the property top
when drag starts
}]
}
Default: {}
ddProps (extended by drag-drop)
Object
Objecthash containing all specific information about the particular drag-cycle. It has a structure like this:
ddProps = {
sourceNode {HtmlElement} original node (defined by drag-drop)
dragNode {HtmlElement} Element that is dragged
x {Number} absolute x-position of the draggable inside document
when the drag starts
y {Number} absolute y-position of the draggable inside document
when the drag starts
inlineLeft {String} inline css of the property left
when drag starts
inlineTop {String} inline css of the property top
when drag starts
winConstrained {Boolean} whether the draggable should be constrained to window
xMouseLast {Number} absolute x-position of the mouse inside document
when the drag starts
yMouseLast {Number} absolute y-position of the draggable inside document
when the drag starts
winScrollLeft {Number} the left-scroll of window when drag starts
winScrollTop {Number} the top-scroll of window when drag starts
constrain = { // constrain-properties when constrained to a HtmlElement
xOrig {Number} x-position in the document, included with left-border-width
yOrig {Number} y-position in the document, included with top-border-width
x {Number} xOrig corrected with scroll-left of the constrained node
y {Number} yOrig corrected with scroll-top of the constrained node
w {Number} scrollWidth
h {Number} scrollHeight
};
dropzoneSpecified {Boolean} whether the draggable has a dropzone specified (either by dd-dropzone
or by dd-emitter
) (defined by drag-drop)
dragOverEv {Object} Eventhandler that watches for mousemove
to detect dropzone-over events (defined by drag-drop)
relatives[{ // Array with objects that represent all draggables that come along with the master-draggable (in case of multiple items), excluded the master draggable itself
sourceNode {HtmlElement} original node (defined by drag-drop)
dragNode {HtmlElement} draggable node
shiftX {Number} the amount of left-pixels that this HtmlElement differs from the dragged element
shiftY {Number} the amount of top-pixels that this HtmlElement differs from the dragged element
inlineLeft {String} inline css of the property left
when drag starts
inlineTop {String} inline css of the property top
when drag starts
}]
relativeDragNodes [HtmlElements] Array with all copyied
Nodes corresponding to ddProps.relatives
. Only in case of copying multiple items (defined by drag-drop)
}
Default: {}
Events
*:dd
Emitted when a draggable Element's drag-cycle starts. You can use a before
-subscriber to specify
e.relatives, which should be a nodelist with HtmlElements, that should be dragged togehter with the master
draggable Element.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe HtmlElement that is being dragged
-
currentTarget
HtmlElementthe HtmlElement that is delegating
-
sourceTarget
HtmlElementthe deepest HtmlElement where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well.
-
*:dd-drag
Emitted during the drag-cycle of a draggable Element (while it is dragged).
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe HtmlElement that is being dragged
-
currentTarget
HtmlElementthe HtmlElement that is delegating
-
sourceTarget
HtmlElementthe deepest HtmlElement where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well.
-
*:dd-drag (extended by drag-drop)
Emitted during the drag-cycle of a draggable Element (while it is dragged).
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe HtmlElement that is being dragged
-
dragNode
HtmlElementThe HtmlElement that is being dragged (equals e.target)
-
[sourceNode]
HtmlElement optionalThe original Element. Only when a
copy
is made --> e.dragNode is being moved while e.sourceNode stand at its place. -
currentTarget
HtmlElementthe HtmlElement that is delegating
-
sourceTarget
HtmlElementthe deepest HtmlElement where the mouse lies upon
-
[dropTarget]
HtmlElement optionalThe dropzone HtmlElement that will be available whenever the draggable gets over a dropzone.
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
[dropzone]
Promise optionala Promise that will be available whenever the draggable gets over a dropzone. The Promise that gets fulfilled as soon as the draggable is dropped, or outside the dropzone Will fulfill with one argument:
onDropzone
{Boolean} whentrue
, the draggable is dropped inside the dropzone, otherwise the draggable got outside the dropzone without beging dropped. -
ctrlKey
BooleanWhether the Ctrl/cmd key is pressed
-
isCopied
BooleanWhether the drag is a copy-drag
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well. -
[relativeDragNodes]
NodeList optionalan optional list that holds the HtmlElements that corresponds with the
e.relative
list, but is a list with draggable Elements.
-
*:dd-drop
Emitted when drag-cycle of a draggable Element is ended.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe HtmlElement that is being dragged
-
currentTarget
HtmlElementthe HtmlElement that is delegating
-
sourceTarget
HtmlElementthe deepest HtmlElement where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well.
-
*:dd-drop (extended by drag-drop)
Emitted when drag-cycle of a draggable Element is ended.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe HtmlElement that is being dragged
-
dragNode
HtmlElementThe HtmlElement that is being dragged (equals e.target)
-
[sourceNode]
HtmlElement optionalThe original Element. Only when a
copy
is made --> e.dragNode is being moved while e.sourceNode stand at its place. -
currentTarget
HtmlElementthe HtmlElement that is delegating
-
sourceTarget
HtmlElementthe deepest HtmlElement where the mouse lies upon
-
[dropTarget]
HtmlElement optionalThe dropzone HtmlElement that will be available whenever the draggable gets over a dropzone.
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
[dropzone]
Promise optionala Promise that will be available whenever the draggable gets over a dropzone. The Promise that gets fulfilled as soon as the draggable is dropped, or outside the dropzone Will fulfill with one argument:
onDropzone
{Boolean} whentrue
, the draggable is dropped inside the dropzone, otherwise the draggable got outside the dropzone without beging dropped. -
ctrlKey
BooleanWhether the Ctrl/cmd key is pressed
-
isCopied
BooleanWhether the drag is a copy-drag
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well. -
[relativeDragNodes]
NodeList optionalan optional list that holds the HtmlElements that corresponds with the
e.relative
list, but is a list with draggable Elements.
-
*:dropzone-drop
Emitted when a draggable gets dropped inside a dropzone.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe dropzone
-
dragNode
HtmlElementThe HtmlElement that is being dragged
-
dropzone
PromiseThe Promise that gets fulfilled as soon as the draggable is dropped, or outside the dropzone Will fulfill with one argument:
onDropzone
{Boolean} whentrue
, the draggable is dropped inside the dropzone, otherwise the draggable got outside the dropzone without beging dropped. -
dropTarget
HtmlElementThe dropzone HtmlElement. Equals e.target
-
ctrlKey
BooleanWhether the Ctrl/cmd key is pressed
-
isCopied
BooleanWhether the drag is a copy-drag
-
[sourceNode]
HtmlElement optionalThe original Element. Only when a
copy
is made --> e.dragNode is being moved while e.sourceNode stand at its place. -
currentTarget
HtmlElementthe HtmlElement that is delegating the draggable
-
sourceTarget
HtmlElementthe deepest HtmlElement of the draggable where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well. -
[relativeDragNodes]
NodeList optionalan optional list that holds the HtmlElements that corresponds with the
e.relative
list, but is a list with draggable Elements.
-
*:dropzone-out
Emitted when the draggable gets out of the dropzone.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe dropzone
-
dragNode
HtmlElementThe HtmlElement that is being dragged
-
dropzone
PromiseThe Promise that gets fulfilled as soon as the draggable is dropped, or outside the dropzone Will fulfill with one argument:
onDropzone
{Boolean} whentrue
, the draggable is dropped inside the dropzone, otherwise the draggable got outside the dropzone without beging dropped. -
dropTarget
HtmlElementThe dropzone HtmlElement. Equals e.target
-
ctrlKey
BooleanWhether the Ctrl/cmd key is pressed
-
isCopied
BooleanWhether the drag is a copy-drag
-
[sourceNode]
HtmlElement optionalThe original Element. Only when a
copy
is made --> e.dragNode is being moved while e.sourceNode stand at its place. -
currentTarget
HtmlElementthe HtmlElement that is delegating the draggable
-
sourceTarget
HtmlElementthe deepest HtmlElement of the draggable where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well. -
[relativeDragNodes]
NodeList optionalan optional list that holds the HtmlElements that corresponds with the
e.relative
list, but is a list with draggable Elements.
-
*:dropzone-over
Emitted when the draggable gets inside a dropzone.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe dropzone
-
dragNode
HtmlElementThe HtmlElement that is being dragged
-
dropzone
PromiseThe Promise that gets fulfilled as soon as the draggable is dropped, or outside the dropzone Will fulfill with one argument:
onDropzone
{Boolean} whentrue
, the draggable is dropped inside the dropzone, otherwise the draggable got outside the dropzone without beging dropped. -
dropTarget
HtmlElementThe dropzone HtmlElement. Equals e.target
-
ctrlKey
BooleanWhether the Ctrl/cmd key is pressed
-
isCopied
BooleanWhether the drag is a copy-drag
-
[sourceNode]
HtmlElement optionalThe original Element. Only when a
copy
is made --> e.dragNode is being moved while e.sourceNode stand at its place. -
currentTarget
HtmlElementthe HtmlElement that is delegating the draggable
-
sourceTarget
HtmlElementthe deepest HtmlElement of the draggable where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well. -
[relativeDragNodes]
NodeList optionalan optional list that holds the HtmlElements that corresponds with the
e.relative
list, but is a list with draggable Elements.
-
dd (extended by drag-drop)
Emitted when a draggable Element's drag-cycle starts. You can use a before
-subscriber to specify
e.relatives, which should be a nodelist with HtmlElements, that should be dragged togehter with the master
draggable Element.
Event Payload:
-
e
Objecteventobject including:
-
target
HtmlElementthe HtmlElement that is being dragged
-
dragNode
HtmlElementThe HtmlElement that is being dragged (equals e.target)
-
[sourceNode]
HtmlElement optionalThe original Element. Only when a
copy
is made --> e.dragNode is being moved while e.sourceNode stand at its place. -
currentTarget
HtmlElementthe HtmlElement that is delegating
-
sourceTarget
HtmlElementthe deepest HtmlElement where the mouse lies upon
-
dd
PromisePromise that gets fulfilled when dragging is ended. The fullfilled-callback has no arguments.
-
ctrlKey
BooleanWhether the Ctrl/cmd key is pressed
-
isCopied
BooleanWhether the drag is a copy-drag
-
xMouse
Numberthe current x-position in the window-view
-
yMouse
Numberthe current y-position in the window-view
-
clientX
Numberthe current x-position in the window-view
-
clientY
Numberthe current y-position in the window-view
-
xMouseOrigin
Numberthe original x-position in the document when drag started (incl. scrollOffset)
-
yMouseOrigin
Numberthe original y-position in the document when drag started (incl. scrollOffset)
-
[relatives]
NodeList optionalan optional list that the user could set in a
before
-subscriber of thedd
-event to inform which nodes are related to the draggable node and should be dragged as well. -
[relativeDragNodes]
NodeList optionalan optional list that holds the HtmlElements that corresponds with the
e.relative
list, but is a list with draggable Elements.
-
dd-fake-mousemove
private
Fired when the mouse comes back into the browser-window while dd-drag was busy yet no buttons are pressed. This is a correction to the fact that the mouseup-event wasn't noticed because the mouse was outside the browser.
dd-fake-mouseup
private
Fired when the mouse comes back into the browser-window while dd-drag was busy yet no buttons are pressed. This is a correction to the fact that the mouseup-event wasn't noticed because the mouse was outside the browser.