dd-ddm-drop-debug.js revision fe9b360fbba5ff31e2640b73a2826010d9c7ca28
3ec8ffa3cd3bf9f3ed0d3f3ddb73b28a99b79f62neil_a_wilson * 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.
3ec8ffa3cd3bf9f3ed0d3f3ddb73b28a99b79f62neil_a_wilson * @submodule dd-ddm-drop
3ec8ffa3cd3bf9f3ed0d3f3ddb73b28a99b79f62neil_a_wilson * @namespace DD
3ec8ffa3cd3bf9f3ed0d3f3ddb73b28a99b79f62neil_a_wilson //TODO CSS class name for the bestMatch..
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * @property _noShim
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * @description This flag turns off the use of the mouseover/mouseout shim. It should not be used unless you know what you are doing.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * @type {Boolean}
3ec8ffa3cd3bf9f3ed0d3f3ddb73b28a99b79f62neil_a_wilson * @property _activeShims
3ec8ffa3cd3bf9f3ed0d3f3ddb73b28a99b79f62neil_a_wilson * @description Placeholder for all active shims on the page
a3d3ab94806056d2355afea6fe8daac41059b9fbludovicp * @type {Array}
0f8553e2af5fc49a510ecfcfc93e66d06713f631ludo * @method _hasActiveShim
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara * @description This method checks the _activeShims Object to see if there is a shim active.
0f8553e2af5fc49a510ecfcfc93e66d06713f631ludo * @return {Boolean}
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 (xy) {
clearCache: function() {
this.validDrops = [];
this.otherDrops = {};
this._activeShims = [];
_activateTargets: function() {
this.clearCache();
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) {
} else if (activeDrag) {
this.activeDrop = null;
_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;