I figured it out. The element isn''t actually getting destroyed from the
page. So instead of reinserting a new element, you should just show the
element that was hidden when dragging.
Mike wrote:> Hey there.
>
> I''m doing something similiar to the demo shopping cart at
> (http://demo.script.aculo.us/shop), but with some differences. When you
> drag an item to the div, it doesn''t return to the original
location, as
> you can only drag one of each item. Also I don''t want to have a
separate
> container to drag deleted items to, so I have a remove link under each
> item. I think the significant difference though, is the fact that my
> draggable is a div, with text and an image, and not just an image like
> the script.aculo.us demo.
>
> When a user clicks remove, this RJS template is called:
>
> page.visual_effect :squish, "item-#{@item.id}", :duration =>
0.6
> page.insert_html :bottom, :items, :partial =>
''item_display''
>
> To show the original item for further dragging. Here''s where the
problem
> comes in:
>
> I can subsequently drag the item back in FireFox, but not in Safari or
> IE. The item just isn''t draggable even though my _item_display
partial
> is the same thing that was rendered when the page loaded, and dragging
> worked then no problem. Also, just so you know, items is a div element
> that the item is inserted into.
>
> If I refresh the page, all is well.
>
> Anyone run into this?
>
> Thanks!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---