Author: hoang_to
Date: 2010-08-13 07:54:37 -0400 (Fri, 13 Aug 2010)
New Revision: 3822
Modified:
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
Log:
EXOGTN-30: Draged component is dropped automatically as the cursor is moved out of browser
border
Modified:
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
---
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-08-13
11:49:54 UTC (rev 3821)
+++
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-08-13
11:54:37 UTC (rev 3822)
@@ -32,6 +32,10 @@
*/
PortalDragDrop.prototype.init = function(e) {
+ if (eXo.core.DragDrop.dndEvent && eXo.core.DragDrop.dndEvent.clickObject ==
this){
+ return;
+ }
+
if (!e) e = window.event;
if(((e.which) && (e.which == 2 || e.which == 3)) || ((e.button) &&
(e.button == 2))) return;
@@ -194,7 +198,9 @@
this.origDragObjectStyle.setProperties(dndEvent.dragObject.style, false) ;
if(dndEvent.foundTargetObject != null || (dndEvent.backupMouseEvent &&
dndEvent.backupMouseEvent.keyCode != 27)) {
- eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
+ if (dndEvent.foundTargetObject.foundIndex != null) {
+ eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
+ }
} else {
if(dndEvent.dragObject.parentNode.nodeName.toLowerCase() == "td") {
dndEvent.dragObject.parentNode.style.width = "auto";
@@ -220,12 +226,6 @@
dndEvent.dragObject.style.width = "auto" ;
};
- DragDrop.cancelCallback = function(dndEvent) {
- if(Browser.browserType == "ie" &&
Browser.findMouseYInClient(dndEvent.backupMouseEvent) < 0) {
- DragDrop.onDrop(dndEvent.backupMouseEvent);
- }
- };
-
var clickObject = this;
var componentBlock = DOMUtil.findAncestorByClass(clickObject,
"UIComponentBlock") ;
@@ -284,7 +284,7 @@
] ;
try {
- dndEvent.lastFoundTargetObject.foundIndex = -1;
+ dndEvent.lastFoundTargetObject.foundIndex = null;
} catch(err) {
}