On Jul 2, 4:04 am, ColinFine <[EMAIL PROTECTED]> wrote:
> On Jul 1, 6:24 pm, Jay K <[EMAIL PROTECTED]> wrote:
>
> > I've got a "Sortable" list that is sorting just fine.  But in the list
> > items, there is a link.  If you mousedown on the link, drag it to a
> > new location and mouseup, the list gets reordered appropriately, but
> > then the link is followed (you did - after all - click it).  Is there
> > a way to either stop the mouseup/click event before activating the
> > link after you've dragged the item, or to not drag at all with the
> > link, that is, not have the link as part of the handle?
>
> > For another project, I'm trying to use a nested list that is a
> > Sortable with {tree:true}, but also have the elements collapse when
> > clicked, and I'm running across the same problem there: an open branch
> > will collapse after being moved (and vise versa), because it is also
> > registering the click.
>
> > Any ideas?
>
> I've not used Sortable much, but IIRC the whole point of using it is
> that it handles the dropping for you. If you used your own onDrop
> callback, then I guess you could do an Event.stop, but I don't think
> there's anywhere you could put that in with Sortable. Sorry.

What I've done to get around this is to absorb the click and redefine
it by activating the link if the mousedown and mouseup are within .25
seconds.  It's way hackier than I like, but it seems to work.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to