blemming a écrit :> Is there a way in the onUpdate function to know which element id was
> moved? Currently, I have only been able to access the container''s
id.
> I would like to use the highlight effect on the div that was just
> moved, but as is below it highlights the entire container.
Actually you''ll need two callbacks:
endeffect: function that takes the dropped element and triggers a new
Effect.Highlight. However, beware: this will break symmetry with the
existing starteffect (see Draggable.prototype.initialize in the source),
so you might need to (a) redefine starteffect to keep control of things
even in future releases, or (b) adjust endeffect to feature the same
code as the default one, which might break in later releases.
update: function that performs your ''mess'' update (use
.update(...)
instead of .innerHTML, that''s more portable...).
I''m not entirely sure endeffect will only be triggered upon successful
drop, though. Test it out.
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---