drag.js revision 23353a53c7478bead2dcf9e89dc706930671ee44
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * Provides the ability to drag a Node.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @module dd
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @submodule dd-drag
09c638a157dd9d2ed9027215d9e254badfa019b8Dav Glass * Provides the ability to drag a Node.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @class Drag
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @extends Base
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @constructor
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @namespace DD
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @event drag:mouseup
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description Handles the mouseup DOM event, does nothing internally just fires.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @bubbles DDM
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * @type {CustomEvent}
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * @event drag:mouseDown
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * @description Handles the mousedown DOM event, checks to see if you have a valid handle then starts the drag timers.
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * @preventable _defMouseDownFn
364e2a6af13dafc0a78fda276167a477b2f7aabfDav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
364e2a6af13dafc0a78fda276167a477b2f7aabfDav Glass * <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>
364e2a6af13dafc0a78fda276167a477b2f7aabfDav Glass * @bubbles DDM
364e2a6af13dafc0a78fda276167a477b2f7aabfDav Glass * @type {CustomEvent}
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * @event drag:afterMouseDown
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description Fires after the mousedown event has been cleared.
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @bubbles DDM
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type {CustomEvent}
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @event drag:removeHandle
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description Fires after a handle is removed.
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @type {CustomEvent}
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @event drag:addHandle
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @description Fires after a handle is added.
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @bubbles DDM
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @type {CustomEvent}
db9067a7aace004de2603396af611d5a294bc554Dav Glass * @event drag:removeInvalid
db9067a7aace004de2603396af611d5a294bc554Dav Glass * @description Fires after an invalid selector is removed.
db9067a7aace004de2603396af611d5a294bc554Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @bubbles DDM
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @type {CustomEvent}
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @event drag:addInvalid
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @description Fires after an invalid selector is added.
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @bubbles DDM
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @type {CustomEvent}
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @event drag:start
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @description Fires at the start of a drag operation.
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * <dt>pageX</dt><dd>The original node position X.</dd>
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * <dt>pageY</dt><dd>The original node position Y.</dd>
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * <dt>startTime</dt><dd>The startTime of the event. getTime on the current Date object.</dd>
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @bubbles DDM
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @type {CustomEvent}
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @event drag:end
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @description Fires at the end of a drag operation.
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
c03e8210b031a389a9441f7f550a03d1272bac31Dav Glass * <dt>pageX</dt><dd>The current node position X.</dd>
c03e8210b031a389a9441f7f550a03d1272bac31Dav Glass * <dt>pageY</dt><dd>The current node position Y.</dd>
c03e8210b031a389a9441f7f550a03d1272bac31Dav Glass * <dt>startTime</dt><dd>The startTime of the event, from the start event.</dd>
a5b442fa7022cb624533685ed17a7cfe6344890dDav Glass * <dt>endTime</dt><dd>The endTime of the event. getTime on the current Date object.</dd>
c03e8210b031a389a9441f7f550a03d1272bac31Dav Glass * @bubbles DDM
c03e8210b031a389a9441f7f550a03d1272bac31Dav Glass * @type {CustomEvent}
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @event drag:drag
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @description Fires every mousemove during a drag operation.
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * <dt>pageX</dt><dd>The current node position X.</dd>
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * <dt>pageY</dt><dd>The current node position Y.</dd>
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * <dt>scroll</dt><dd>Should a scroll action occur.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>info</dt><dd>Object hash containing calculated XY arrays: start, xy, delta, offset</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type {CustomEvent}
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @event drag:align
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @preventable _defAlignFn
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @description Fires when this node is aligned.
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>pageX</dt><dd>The current node position X.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>pageY</dt><dd>The current node position Y.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type {CustomEvent}
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @event drag:over
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @description Fires when this node is over a Drop Target. (Fired from dd-drop)
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drop</dt><dd>The drop object at the time of the event.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drag</dt><dd>The drag object at the time of the event.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type {CustomEvent}
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @event drag:enter
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @description Fires when this node enters a Drop Target. (Fired from dd-drop)
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drop</dt><dd>The drop object at the time of the event.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drag</dt><dd>The drag object at the time of the event.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type {CustomEvent}
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @event drag:exit
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @description Fires when this node exits a Drop Target. (Fired from dd-drop)
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drop</dt><dd>The drop object at the time of the event.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type {CustomEvent}
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @event drag:drophit
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @description Fires when this node is dropped on a valid Drop Target. (Fired from dd-ddm-drop)
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drop</dt><dd>The best guess on what was dropped on.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>drag</dt><dd>The drag object at the time of the event.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @bubbles DDM
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type {CustomEvent}
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @event drag:dropmiss
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @description Fires when this node is dropped on an invalid Drop Target. (Fired from dd-ddm-drop)
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @param {EventFacade} event An Event Facade object with the following specific property added:
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * <dt>pageX</dt><dd>The current node position X.</dd>
677d6ad6503f3daaaaf9800c58eec9e00fee4cddDav Glass * <dt>pageY</dt><dd>The current node position Y.</dd>
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @bubbles DDM
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type {CustomEvent}
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass Drag = function(o) {
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass Drag.superclass.constructor.apply(this, arguments);
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass Y.error('Failed to register node, already in use: ' + o.node);
0523d0a8daaa474f0214203f8cbb0bc4a88e2964Dav Glass * This property defaults to "mousedown", but when drag-gestures is loaded, it is changed to "gesturemovestart"
5432371fbb6d790a76159481f0dd16e806812153Dav Glass * @property START_EVENT
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @attribute node
5432371fbb6d790a76159481f0dd16e806812153Dav Glass * @description Y.Node instance to use as the element to initiate a drag operation
5432371fbb6d790a76159481f0dd16e806812153Dav Glass * @type Node
5432371fbb6d790a76159481f0dd16e806812153Dav Glass * @attribute dragNode
5432371fbb6d790a76159481f0dd16e806812153Dav Glass * @description Y.Node instance to use as the draggable element, defaults to node
5432371fbb6d790a76159481f0dd16e806812153Dav Glass * @type Node
f7aa62ea2e8cf43fbb9d83db5060db540ff1893fDav Glass Y.error('DD.Drag: Invalid dragNode Given: ' + node);
f7aa62ea2e8cf43fbb9d83db5060db540ff1893fDav Glass * @attribute offsetNode
f7aa62ea2e8cf43fbb9d83db5060db540ff1893fDav Glass * @description Offset the drag element by the difference in cursor position: default true
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Boolean
96c1e6aab172b57cf3566abee931c26676990044Dav Glass * @attribute startCentered
96c1e6aab172b57cf3566abee931c26676990044Dav Glass * @description Center the dragNode to the mouse position on drag:start: default false
6dbc2e0b2c23ae7763959af9762fc50c84dbd937Dav Glass * @type Boolean
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute clickPixelThresh
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @description The number of pixels to move to start a drag operation, default is 3.
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @type Number
0db84e0da684308b0fd9ea9b5906c11bafa7a246Dav Glass * @attribute clickTimeThresh
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Number
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute lock
162527ab925c04aa8d6bbf78d0484a133a8076f1Dav Glass * @description Set to lock this drag element so that it can't be dragged: default false.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Boolean
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass this.get(NODE).addClass(DDM.CSS_PREFIX + '-locked');
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass this.get(NODE).removeClass(DDM.CSS_PREFIX + '-locked');
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute data
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description A payload holder to store arbitrary data about this drag object, can be used to store any value.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Mixed
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute move
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description If this is false, the drag element will not move with the cursor: default true. Can be used to "resize" the element.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Boolean
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute useShim
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description Use the protective shim on all drag operations: default true. Only works with dd-ddm, not dd-ddm-base.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Boolean
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute activeHandle
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description This config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Node
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute primaryButtonOnly
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description By default a drag operation will only begin if the mousedown occurred with the primary mouse button. Setting this to false will allow for all mousedown events to trigger a drag.
d0bccce76452becc96b65acaaa684aa6fabaf386Dav Glass * @type Boolean
d0bccce76452becc96b65acaaa684aa6fabaf386Dav Glass * @attribute dragging
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Boolean
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @attribute target
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @description This attribute only works if the dd-drop module has been loaded. It will make this node a drop target as well as draggable.
d2a5a45ff58ab15a8ee0339edcd03f0243373d59Dav Glass * @type Boolean
value: false,
return config;
* @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance.
dragMode: {
value: null,
groups: {
getter: function() {
if (!this._groups) {
this._groups = {};
var ret = [];
return ret;
setter: function(g) {
this._groups = {};
Y.each(g, function(v, k) {
this._groups[v] = true;
* @description Array of valid handles to add. Adding something here will set all handles, even if previously added with addHandle
handles: {
value: null,
setter: function(g) {
this._handles = {};
Y.each(g, function(v, k) {
var key = v;
this._handles = null;
* @description Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config
bubbles: {
setter: function(t) {
this.addTarget(t);
haltDown: {
value: true
_canDrag: function(n) {
* @description Add this Drag instance to a group, this should be used for on-the-fly group additions.
addToGroup: function(g) {
this._groups[g] = true;
* @description Remove this Drag instance from a group, this should be used for on-the-fly group removals.
removeFromGroup: function(g) {
delete this._groups[g];
* @description This will be a reference to the Drop instance associated with this drag if the target: true config attribute is set..
target: null,
if (config === false) {
if (this.target) {
this.target = null;
config = {};
config.bubbleTargets = ('bubbleTargets' in config) ? config.bubbleTargets : Y.Object.values(this._yuievt.targets);
_groups: null,
* @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling.
_createEvents: function() {
queuable: false,
emitFacade: true,
bubbles: true,
queuable: false,
emitFacade: true,
bubbles: true,
queuable: false,
emitFacade: true,
bubbles: true,
queuable: false,
emitFacade: true,
bubbles: true,
var ev = [
this.publish(v, {
type: v,
emitFacade: true,
bubbles: true,
preventable: false,
queuable: false,
_ev_md: null,
* @description The getTime of the mousedown event. Not used, just here in case someone wants/needs to use it.
_startTime: null,
* @description The getTime of the mouseup event. Not used, just here in case someone wants/needs to use it.
_endTime: null,
_handles: null,
_invalids: null,
* @description A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true}
_dragThreshMet: null,
_fromTimeout: null,
_clickTimeout: null,
deltaXY: null,
startXY: null,
nodeXY: null,
lastXY: null,
* @description The xy that the node will be set to. Changing this will alter the position as it's dragged.
actXY: null,
realXY: null,
mouseXY: null,
region: null,
this._fixIEMouseUp();
* @description The function we use as the ondragstart handler when we start a drag in Internet Explorer. This keeps IE from blowing up on images as drag handles.
_fixDragStart: function(e) {
e.preventDefault();
* @description The function we use as the onselectstart handler when we start a drag in Internet Explorer
_ieSelectFix: function() {
* @description We will hold a copy of the current "onselectstart" method on this property, and reset it after we are done using it.
_ieSelectBack: null,
* @description This method copies the onselectstart listner on the document to the _ieSelectFix property
_fixIEMouseDown: function(e) {
* @description This method copies the _ieSelectFix property back to the onselectstart listner on the document.
_fixIEMouseUp: function() {
_defMouseDownFn: function(e) {
this._dragThreshMet = false;
* @description Method first checks to see if we have handles, if so it validates the click against the handle. Then if it finds a valid handle, it checks it against the invalid handles list. Returns true if a good handle was used, false otherwise.
hTest = null,
els = null,
nlist = null,
set = false;
if (this._handles) {
nlist = i;
hTest = n;
if (this._invalids) {
if (hTest) {
set = false;
set = true;
_timeoutCheck: function() {
this.start();
* @description Add a handle to a drag element. Drag only initiates when a mousedown happens on this element.
if (!this._handles) {
this._handles = {};
* @description Add a selector string to test the handle against. If the test passes the drag operation will not continue.
this.actXY = [];
this._createEvents();
_prep: function() {
this._dragThreshMet = false;
_unprep: function() {
this.mouseXY = [];
this.startXY = [];
this.nodeXY = [];
this.lastXY = [];
this.actXY = [];
this.realXY = [];
start: function() {
this.region = {
end: function() {
if (this._clickTimeout) {
_defEndFn: function(e) {
this._fixIEMouseUp();
this._ev_md = null;
* @description Handler for preventing the drag:end event. It will reset the node back to it's start position
_prevEndFn: function(e) {
this._fixIEMouseUp();
this._ev_md = null;
this.region = null;
_defAlignFn: function(e) {
this._moveNode();
this.region = {
info: {
_defDragFn: function(e) {
if (e.scroll) {
if (!this._dragThreshMet) {
this._dragThreshMet = true;
this.start();
if (this._clickTimeout) {
* @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag.
stopDrag: function() {
destructor: function() {
this._unprep();
if (this.target) {