Forum: Ruby on Rails Scroll Page While Dragging 'draggable_element'

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5241688de828aae4efd2b89fc3dff00b?d=identicon&s=25 Brandon (Guest)
on 2007-07-26 07:33
(Received via mailing list)
Hi - I posted this on another list, but received no response, so I'm
trying this one.  My apologies to those who have seen this question

I have two columns, one of draggable elements, the other of
droppable elements. These are used to add items to a particular
collection.  (Story :habtm 'Assets')

Column 1 (Assets)            Column 2 (Stories)
==============          ==============
Draggable 1                     Droppable 1
Draggable 2                     Droppable 2
...                                    ...

I need to be able to drag any item from the first column onto any item
in the second column, even when the lists are long and both elements
are not visible on the screen at once, so I need the page to scroll
when I drag an asset to the edge of the browser screen.

I currently use the draggable_element helper on each of the assets,
and drop_receiving_element on each of the stories.  What can I do so
that when I want to drag an asset to a story that is off-screen, the
page will scroll until that story comes into view?

Many thanks,
9bb51d32191ba06591773be7fed21b3d?d=identicon&s=25 ff (Guest)
on 2007-07-27 10:34
(Received via mailing list)

> Hi - I posted this on another list, but received no response,

AFAIK, it is because of the general problem, you have with drag&drag and
scrollable parts ("overflow: scroll" / "overflow: auto")

<a href="">Drag draggables outside
overflow:auto div to an external droppable container</a>

so either you use intensively Javascript or find some workarounds:

scroll hack and draggable element substitution</a>

(link doesn't work at the moment, sorry, but hopefully the Patch should
give you
some hints)

This topic is locked and can not be replied to.