Start with position of the mousedown event, not of the mouseevent (after
authorJan Schneider <jan@horde.org>
Tue, 20 Apr 2010 17:09:39 +0000 (19:09 +0200)
committerJan Schneider <jan@horde.org>
Tue, 20 Apr 2010 17:09:39 +0000 (19:09 +0200)
applying the threshold).
This fixes ghosts not being under the mouse pointer when dragging fast.

horde/js/dragdrop2.js

index 3738539..191a6be 100644 (file)
@@ -322,6 +322,10 @@ Drag = Class.create({
 
         if (!this.options.caption) {
             if (!this.ghost) {
+                // Use the position of the original click event as the start
+                // coordinate.
+                xy = [ this.clickEvent.pointerX(), this.clickEvent.pointerY() ];
+
                 // Create the "ghost", i.e. the moving element, a clone of the
                 // original element, if it doesn't exist yet.
                 var layout = this.element.getLayout();