Here's a diff file (created with 'diff -u') against the dragdrop.js in
1.6.0 to move the dragged element while scrolling.  It fixes the
previous problem of continuing to move the item off the top of the page.

I'd like to have it included, if possible, so if there are more changes
needed, let me know.  

Thanks,
Greg
--- dragdrop.js 2006-03-28 10:27:00.000000000 -0700
+++ prototype/dragdrop.js       2006-03-30 15:47:36.000000000 -0700
@@ -412,6 +412,7 @@
     if(this.scrollInterval) {
       clearInterval(this.scrollInterval);
       this.scrollInterval = null;
+      Draggables._lastScrollPointer = null;
     }
   },
   
@@ -440,7 +441,14 @@
     Position.prepare();
     Droppables.show(Draggables._lastPointer, this.element);
     Draggables.notify('onDrag', this);
-    this.draw(Draggables._lastPointer);    
+    Draggables._lastScrollPointer = Draggables._lastScrollPointer || 
$A(Draggables._lastPointer);
+    Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
+    Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
+    if (Draggables._lastScrollPointer[0] < 0)
+      Draggables._lastScrollPointer[0] = 0;
+    if (Draggables._lastScrollPointer[1] < 0)
+      Draggables._lastScrollPointer[1] = 0;
+    this.draw(Draggables._lastScrollPointer);
     
     if(this.options.change) this.options.change(this);
   },
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to