drop.js revision f5bea9cc144a6881ddea5383d3efe238b6d9b3df
1537N/A * 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.
var Drop = function() {
this._createShim();
node: {
groups: {
set: function(g) {
this._groups = {};
Y.each(g, function(v, k) {
this._groups[v] = true;
padding: {
set: function(p) {
lock: {
value: false,
if (lock) {
* @description Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling.
bubbles: {
writeOnce: true,
* @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling.
_createEvents: function() {
var ev = [
this.publish(v, {
type: v,
emitFacade: true,
preventable: false,
bubbles: true,
queuable: true
_valid: null,
_groups: null,
shim: null,
* @description A region object associated with this target, used for checking regions while dragging.
region: null,
overTarget: null,
this._valid = false;
var ret = false;
if (this._groups[v]) {
ret = true;
this._valid = true;
return ret;
initializer: function() {
this._createEvents();
destructor: function() {
if (this.shim) {
this.shim = null;
* @description Removes classes from the target, resets some flags and sets the shims deactive position [-999, -999]
_deactivateShim: function() {
this.overTarget = false;
_activateShim: function() {
this.overTarget = false;
this.sizeShim();
* @description Positions and sizes the shim with the raw data from the node, this can be used to programatically adjust the Targets shim for Animation..
sizeShim: function() {
this.region = {
_createShim: function() {
s.setStyles({
this.shim = s;
_handleTargetOver: function() {
if (this.overTarget) {
this.overTarget = true;
this._handleOut();
_handleOverEvent: function() {
_handleOutEvent: function() {
_handleOut: function() {
if (this.overTarget) {
this.overTarget = false;