dd-ddm-drop.js revision 7e5a8a1727b2daa941a45bbb3d0296d2d5600a9f
c0ead1173ff6750267f0beab1c9ed13b1713000aprokoudine * Extends the dd-ddm Class to add support for the placement of Drop Target shims inside the viewport shim. It also handles all Drop Target related events and interactions.
c0ead1173ff6750267f0beab1c9ed13b1713000aprokoudine * @module dd
c0ead1173ff6750267f0beab1c9ed13b1713000aprokoudine * @submodule dd-ddm-drop
6b464dfa85f56bbe7e0ff053bcb709fe346a5e2cJazzyNico * @namespace DD
6b464dfa85f56bbe7e0ff053bcb709fe346a5e2cJazzyNico //TODO CSS class name for the bestMatch..
e277736a64d0dfc4dba152258dc512f6ad710ba3Alvin Penner * @property _noShim
e277736a64d0dfc4dba152258dc512f6ad710ba3Alvin Penner * @description This flag turns off the use of the mouseover/mouseout shim. It should not be used unless you know what you are doing.
e277736a64d0dfc4dba152258dc512f6ad710ba3Alvin Penner * @type {Boolean}
c0ead1173ff6750267f0beab1c9ed13b1713000aprokoudine * @property _activeShims
_activeShims: [],
_hasActiveShim: function() {
if (this._noShim) {
_addActiveShim: function(d) {
_removeActiveShim: function(d) {
s[s.length] = v;
this._activeShims = s;
* @description This method will sync the position of the shims on the Drop Targets that are currently active.
}, force);
* @description The mode that the drag operations will run in 0 for Point, 1 for Intersect, 2 for Strict
* @description In intersect mode, a Drop is targeted by "part" of the drag node being over the Target
* @description Should we only check targets that are in the viewport on drags (for performance), default: true
useHash: true,
activeDrop: null,
validDrops: [],
* @description An object literal of Other Drop Targets that we encountered during this interaction (in the case of overlapping Drop Targets)
otherDrops: {},
targets: [],
* @description Add a Drop Target to the list of Valid Targets. This list get's regenerated on each new drag operation.
* @description Removes a Drop Target from the list of Valid Targets. This list get's regenerated on each new drag operation.
var drops = [];
if (v !== drop) {
if (this._noShim) {
clearCache: function() {
this.validDrops = [];
this.otherDrops = {};
this._activeShims = [];
_activateTargets: function() {
this._noShim = true;
this.clearCache();
v._activateShim([]);
this._noShim = false;
this._handleTargetOver();
* @description This method will gather the area for all potential targets and see which has the hightest covered area and return it.
* @param {Boolean} all If present, it returns an Array. First item is best match, second is an Array of the other items in the original Array.
biggest = v;
if (all) {
out = [];
if (v !== biggest) {
return biggest;
* @description This method fires the drop:hit, drag:drophit, drag:dropmiss methods and deactivates the shims..
_deactivateTargets: function() {
if (activeDrop) {
this.activeDrop = null;
v._deactivateShim([]);
_dropMove: function() {
if (this._hasActiveShim()) {
this._handleTargetOver();
_lookup: function() {
return this.validDrops;
var drops = [];
return drops;
_handleTargetOver: function() {
_regTarget: function(t) {
if (v != drop) {
vdrops = [];
if (v !== drop) {
var drop = false,
if (n instanceof Y.Node) {
drop = v;
return drop;