If anyone is interested and having the same problem ... I think I have
solved this by using the following information (taken from
http://dev.rubyonrails.org/ticket/5174):

I made the additions to dragdrop.js and all seems to be working now!

->>

The following defect was noticed from Script.Aculo.us versions 1.5.3
to 1.6.1.

I have a DIV container which has a set width and height. It is set to
auto-scroll with "overflow: auto" style. It contains a bunch of
Droppable elements (with onHover/onDrop events and some options
parameters). I noticed that if I scroll the container to reveal a
Droppable element at the bottom, when I drag a Draggable element to
it, the code somehow thinks the Droppable element is a certain
distance higher in the container. The vertical distance in error is
the same as the scrolled distance. Therefore, when I drop the element,
it goes to the wrong Droppable area in another location.

I have looked at dragdrop.js, particularly the Droppables.isAffected()
and Droppables.show() methods. They are using prototype's
Position.within() method to detect if the mouse event position is
within any Droppable element's boundaries. However, by default,
Position.within() method does not use its "includeScrollOffsets"
boolean member. This boolean member is set to false by default and I
couldn't find anywhere in the prototype.js that sets it to true.

My work-around for now is to find "Position.prepare();" string within
dragdrop.js, and manually add "Position.includeScrollOffsets = true;"
at the next line. This seems to have fixed the above issue. The three
places I've updated are Droppables.fire(), Draggable.updateDrag(), and
Draggable.scroll().

Of course, because of my limited knowledge of prototype and
Script.Aculo.us, there may be much better solution to the issue. I'm
looking forward to seeing this issue getting resolved in your later
releases. Thanks!

On 6 June, 11:05, "Ruby on Rails: Talk" <[email protected]> wrote:
> Thanks Naren but it's not working. I don't need to scroll the window
> when I drag. I scroll before I drag. But the droppables are not
> scrolling with the div :(
>
> I have a calendar in a div which scrolls. I scroll the calendar before
> I drag the appointment into place. When dragging the appointment into
> place it still seems to have the droppable values before the scroll!
>
> It's now beginning to drive me to drink lol.
>
> Any ideas?
>
> On 6 June, 05:59, Naren <[email protected]> wrote:
>
> > Hi Derren ,
>
> > You can set scroll: window when you creating dragable div (time in
> > your case)
>
> > like
>
> > Draggable(id,{
> >         handle:handle,
> >         scroll: window,
> >         revert:true
> >         });
>
> > when you set scroll:window it handle your scroll event.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to