Author: pyaschenko
Date: 2009-01-23 10:36:03 -0500 (Fri, 23 Jan 2009)
New Revision: 12403
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
Log:
https://jira.jboss.org/jira/browse/RF-5834
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2009-01-23
15:26:19 UTC (rev 12402)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2009-01-23
15:36:03 UTC (rev 12403)
@@ -19,12 +19,22 @@
this.onupBound = this.onup.bindAsEventListener(this);
},
- activate: function(event) {
+ activate: function(event) {
Event.observe(document, "mousemove", this.onmoveBound);
Event.observe(document, "mouseup", this.onupBound);
if (event.type == "mousemove") {
this.onmoveBound(event);
}
+ // prevent text selection in IE
+ this.onSelectStartHandler = document.onselectstart;
+ this.onDragStartHandler = document.ondragstart;
+
+ document.onselectstart = function () { return false; };
+ document.ondragstart = function () { DnD.ieReleaseCapture(); return false; };
+
+ if (document.releaseCapture) {
+ Event.observe(document, "mousemove", DnD.ieReleaseCapture);
+ }
},
onmove: function(event) {
@@ -58,6 +68,13 @@
deactivate: function() {
Event.stopObserving(document, "mousemove", this.onmoveBound);
Event.stopObserving(document, "mouseup", this.onupBound);
+
+ document.onselectstart = this.onSelectStartHandler;
+ document.ondragstart = this.onDragStartHandler;
+
+ if (document.releaseCapture) {
+ Event.stopObserving(document, "mousemove", DnD.ieReleaseCapture);
+ }
}
};
@@ -207,18 +224,7 @@
Event.observe(document, "mousemove", this.dragTrigger);
this.lastDragX = Event.pointerX(event);
- this.lastDragY = Event.pointerY(event);
-
- // prevent text selection in IE
- this.onSelectStartHandler = document.onselectstart;
- this.onDragStartHandler = document.ondragstart;
-
- document.onselectstart = function () { return false; };
- document.ondragstart = function () { DnD.ieReleaseCapture(); return false; };
-
- if (document.releaseCapture) {
- Event.observe(document, "mousemove", DnD.ieReleaseCapture);
- }
+ this.lastDragY = Event.pointerY(event);
}
},
@@ -263,13 +269,6 @@
this.lastDragX = undefined;
this.lastDragY = undefined;
- document.onselectstart = this.onSelectStartHandler;
- document.ondragstart = this.onDragStartHandler;
-
- if (document.releaseCapture) {
- Event.stopObserving(document, "mousemove", DnD.ieReleaseCapture);
- }
-
if (this.endDragListener) {
this.endDragListener.deactivate();
}