Author: nbelaevski
Date: 2007-04-27 16:29:14 -0400 (Fri, 27 Apr 2007)
New Revision: 591
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
Log:
RF-128 pre-fixes
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-04-27
18:48:41 UTC (rev 590)
+++
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-04-27
20:29:14 UTC (rev 591)
@@ -100,6 +100,7 @@
return false;
} else {
+ //TODO handle mouseover to update coords
var x = Event.pointerX(event);
var y = Event.pointerY(event);
@@ -183,7 +184,9 @@
}
if (this.mouseMoveProvidesButton && !Event.isLeftClick(event)) {
- DnD.endDrag(event);
+ if (window.drag) {
+ DnD.endDrag(event);
+ }
return false;
}
Modified:
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
===================================================================
---
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-04-27
18:48:41 UTC (rev 590)
+++
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-04-27
20:29:14 UTC (rev 591)
@@ -57,18 +57,20 @@
},
listenDrag: function(e) {
- if (this.startDrag(e)) {
- Event.stopObserving(this.id, "mousemove", this.listenDragBound);
- Event.stopObserving(this.id, "mouseup", this.stopListenDragBound);
- //this.dragStarted = true;
+ if (this.onupdatedrag(e)) {
+ if (this.startDrag(e)) {
+ Event.stopObserving(document, "mousemove", this.listenDragBound);
+ Event.stopObserving(document, "mouseup", this.stopListenDragBound);
+ //this.dragStarted = true;
+ }
}
},
stopListenDrag: function(e) {
//this.dragStarted = false;
- Event.stopObserving(this.id, "mousemove", this.listenDragBound);
- Event.stopObserving(this.id, "mouseup", this.stopListenDragBound);
+ Event.stopObserving(document, "mousemove", this.listenDragBound);
+ Event.stopObserving(document, "mouseup", this.stopListenDragBound);
},
initDrag: function(event) {
@@ -83,8 +85,8 @@
Event.stop(event);
- Event.observe(this.id, "mousemove", this.listenDragBound);
- Event.observe(this.id, "mouseup", this.stopListenDragBound);
+ Event.observe(document, "mousemove", this.listenDragBound);
+ Event.observe(document, "mouseup", this.stopListenDragBound);
}
}
});
\ No newline at end of file
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
---
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-04-27
18:48:41 UTC (rev 590)
+++
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-04-27
20:29:14 UTC (rev 591)
@@ -265,8 +265,7 @@
Event.observe(this.elements.icon, "mousemove", this.listenDragBound);
Event.observe(this.elements.text, "mousemove", this.listenDragBound);
- Event.observe(this.elements.icon, "mouseup", this.stopListenDragBound);
- Event.observe(this.elements.text, "mouseup", this.stopListenDragBound);
+ Event.observe(document, "mouseup", this.stopListenDragBound);
}
}
@@ -309,12 +308,13 @@
},
listenDrag: function(e) {
- if (this.startDrag(e)) {
- Event.stopObserving(this.elements.icon, "mousemove", this.listenDragBound);
- Event.stopObserving(this.elements.text, "mousemove", this.listenDragBound);
-
- Event.stopObserving(this.elements.icon, "mouseup",
this.stopListenDragBound);
- Event.stopObserving(this.elements.text, "mouseup",
this.stopListenDragBound);
+ if (this.onupdatedrag(e)) {
+ if (this.startDrag(e)) {
+ Event.stopObserving(this.elements.icon, "mousemove",
this.listenDragBound);
+ Event.stopObserving(this.elements.text, "mousemove",
this.listenDragBound);
+
+ Event.stopObserving(document, "mouseup", this.stopListenDragBound);
+ }
}
},
@@ -322,7 +322,6 @@
Event.stopObserving(this.elements.icon, "mousemove", this.listenDragBound);
Event.stopObserving(this.elements.text, "mousemove", this.listenDragBound);
- Event.stopObserving(this.elements.icon, "mouseup",
this.stopListenDragBound);
- Event.stopObserving(this.elements.text, "mouseup",
this.stopListenDragBound);
+ Event.stopObserving(document, "mouseup", this.stopListenDragBound);
}
}