My solution worked fine for me. I used it on a page with a bunch of
links and inside each link was a thumbnail image. I was pleased with
the results, but did not research if there was *better* ways to
achieve the goal.
If you look at the complete code example I gave you, I've implemented
a click event on each draggable item, and this method calls the
stopScrolling and finishDrag events as needed for clean-up.
-justin
On 4/17/07, arthur <[EMAIL PROTECTED]> wrote:
>
> (this is my second attempt to answer, I don't know why, google skipped
> the first)
>
> First of all, thanks to all for the answers, I was not expected that,
> so quickly !
>
> On 14 avr, 14:12, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> >
> > Hrm... You mean the delay option works, but when you do release the
> > drag, it ends up clicking?
> >
>
> In fact, at first I didn't even try the delay option, because it was
> still not documented on wiki.script.aculo.us.
> I just tried, and it works just like it should, thanks.
>
> If I do nothing more, when I release the drag, it ends up clicking,
> yes.
> I just want to not end up clicking in case of a drag.
>
> Ken's answer just implemented the solution I quote from in my first
> mail. Thanks a lot.
> I think it could be simplier with using the "change" function instead
> of the "startEffect" function to set tileMove to true if we want to
> keep startEffect defaults :
>
> var tileMoved = false;
>
> function makeDraggable(tileDiv) {
> new Draggable(tileDiv, {
> revert: true,
> reverteffect: function(el, yOffset, xOffset) {
> // A hack, using reverteffect() to do onDrop
> processing
> tileMoved=false; // Reset tile moved because
> we've already prevented the link
> },
> change: function(element) {tileMoved=true;} // my
> modification
> });
> }
> But it's still a hack, like you said !
>
> Justin's solution seems to me dangerous : there is nothing left in the
> endrop function, so we lost stopScrolling(), all the stuff in
> finishDrag(event, true), and the event is not stop :
> from dragdrop.js :
> endDrag: function(event) {
> if(!this.dragging) return;
> this.stopScrolling();
> this.finishDrag(event, true);
> Event.stop(event);
> },
>
> Could this solution raise problems ?
>
> Thanks a lot to all !
>
> Arthur
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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 [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-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---