dd-delegate.js revision 4d589fe0c1bf5d088a90cdf29f3bc777942006cb
/**
* The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.
* @module dd
* @submodule dd-delegate
*/
/**
* This class provides the ability to drag multiple nodes under a container element.
* @class Delegate
* @extends Base
* @constructor
* @namespace DD
*/
var D = function(o) {
},
D.NAME = 'delegate';
D.ATTRS = {
/**
* @attribute cont
* @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container.
* @type String
*/
cont: {
value: 'body'
},
/**
* @attribute nodes
* @description A selector query to get the children of the "container" to make draggable elements from.
* @type String
*/
nodes: {
value: '.dd-draggable'
},
/**
* @attribute lastNode
* @description Y.Node instance of the last item dragged.
* @type Node
*/
lastNode: {
},
/**
* @attribute currentNode
* @description Y.Node instance of the currently dragging node.
* @type Node
*/
currentNode: {
},
/**
* @attribute over
* @description Is the mouse currently over the container
* @type Boolean
*/
over: {
value: false
},
/**
* @attribute target
* @description Should the items also be a drop target.
* @type Boolean
*/
target: {
value: false
}
};
/**
* @property _dd
* @description A reference to the temporary dd instance used under the hood.
*/
_dd: null,
/**
* @property _shimState
* @description The state of the Y.DD.DDM._noShim property to it can be reset.
*/
_shimState: null,
initializer: function() {
//Create a tmp DD instance under the hood.
bubbles: this
});
//Set this as the target
//On end drag, detach the listeners
}, this));
//Attach the delegate to the container
} else {
}
}, this), this.get('cont'));
}, this), this.get('cont'));
this.syncTargets();
},
/**
* @method syncTargets
* @description Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query.
* @return {Self}
* @chainable
*/
syncTargets: function() {
Y.error('DD.Delegate: Drop Plugin Not Found');
return;
}
if (this.get('target')) {
if (!i.drop) {
}
});
}
return this;
},
//TODO
return this;
},
destructor: function() {
if (this._dd) {
}
}
});
Y.namespace('DD');
}, '@VERSION@' ,{skinnable:false, requires:['dd-drag', 'event-mouseenter'], optional:['dd-drop-plugin']});