Author: nbelaevski
Date: 2007-03-20 14:52:01 -0400 (Tue, 20 Mar 2007)
New Revision: 102
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
Log:
http://jira.jboss.com/jira/browse/RF-22 Fixed.
onupdatedrag added to DnD.Draggable. The algorithm to check:
1. check first "mousemove" event if it provides button property (IE only)
2. abort drag on next mousemove event if left button is not pressed
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
---
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-03-20
14:23:52 UTC (rev 101)
+++
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-03-20
18:52:01 UTC (rev 102)
@@ -142,6 +142,26 @@
this.options.ondragend();
}
},
+
+ onupdatedrag: function(event) {
+ if ("mousemove" == event.type) {
+ if (!this.mouseMoveProvidesButtonChecked) {
+ this.mouseMoveProvidesButtonChecked = true;
+ if (!this.mouseMoveProvidesButton) {
+ this.mouseMoveProvidesButton = event.button != 0;
+ }
+ }
+
+ if (this.mouseMoveProvidesButton && !Event.isLeftClick(event)) {
+ DnD.endDrag(event);
+
+ return false;
+ }
+ }
+
+ return true;
+ },
+
/**
* cubclasses may define custom behavior
* @param {Object} drag