Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/DDCore.html view on Meta::CPAN
if (overEvts.length) {
dragCurrent.b4DragOver(e, overEvts);
dragCurrent.onDragOver(e, overEvts);
}
if (dropEvts.length) {
dragCurrent.b4DragDrop(e, dropEvts);
dragCurrent.onDragDrop(e, dropEvts);
}
} else {
// fire dragout events
for (i=0, len=outEvts.length; i<len; ++i) {
dragCurrent.b4DragOut(e, outEvts[i].id);
dragCurrent.onDragOut(e, outEvts[i].id);
}
// fire enter events
for (i=0,len=enterEvts.length; i<len; ++i) {
// dc.b4DragEnter(e, oDD.id);
dragCurrent.onDragEnter(e, enterEvts[i].id);
}
// fire over events
for (i=0,len=overEvts.length; i<len; ++i) {
dragCurrent.b4DragOver(e, overEvts[i].id);
dragCurrent.onDragOver(e, overEvts[i].id);
}
// fire drop events
for (i=0, len=dropEvts.length; i<len; ++i) {
dragCurrent.b4DragDrop(e, dropEvts[i].id);
dragCurrent.onDragDrop(e, dropEvts[i].id);
}
}
// notify about a drop that did not find a target
if (isDrop && !dropEvts.length) {
dragCurrent.onInvalidDrop(e);
}
},
<span id='Ext-dd-DragDropMgr-method-getZIndex'> /**
</span> * @private
* Collects the z-index of the passed element, looking up the parentNode axis to find an absolutely positioned ancestor
* which is able to yield a z-index. If found to be not absolutely positionedm returns -1.
*
* This is used when sorting potential drop targets into z-index order so that only the topmost receives `over` and `drop` events.
*
* @return {Number} The z-index of the element, or of its topmost absolutely positioned ancestor. Returns -1 if the element is not
* absolutely positioned.
*/
getZIndex: function(element) {
var body = document.body,
z,
zIndex = -1;
element = Ext.getDom(element);
while (element !== body) {
if (!isNaN(z = Number(Ext.fly(element).getStyle('zIndex')))) {
zIndex = z;
}
element = element.parentNode;
}
return zIndex;
},
<span id='Ext-dd-DragDropMgr-method-byZIndex'> /**
</span> * @private
* Utility method to pass to {@link Ext.Array#sort} when sorting potential drop targets by z-index.
*/
byZIndex: function(d1, d2) {
return d1.zIndex < d2.zIndex;
},
<span id='Ext-dd-DragDropMgr-method-getBestMatch'> /**
</span> * Helper function for getting the best match from the list of drag
* and drop objects returned by the drag and drop events when we are
* in INTERSECT mode. It returns either the first object that the
* cursor is over, or the object that has the greatest overlap with
* the dragged element.
* @method getBestMatch
* @param {DragDrop[]} dds The array of drag and drop objects
* targeted
* @return {DragDrop} The best single match
*/
getBestMatch: function(dds) {
var winner = null;
// Return null if the input is not what we expect
//if (!dds || !dds.length || dds.length == 0) {
// winner = null;
// If there is only one item, it wins
//} else if (dds.length == 1) {
var len = dds.length;
if (len == 1) {
winner = dds[0];
} else {
// Loop through the targeted items
for (var i=0; i<len; ++i) {
var dd = dds[i];
// If the cursor is over the object, it wins. If the
// cursor is over multiple matches, the first one we come
// to wins.
if (dd.cursorIsOver) {
winner = dd;
break;
// Otherwise the object with the most overlap wins
} else {
if (!winner ||
winner.overlap.getArea() < dd.overlap.getArea()) {
winner = dd;
}
}
}
}
return winner;
},
( run in 1.543 second using v1.01-cache-2.11-cpan-787462296c9 )