Forum: Ruby on Rails Sequential "page." commands in a js.rjs file?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Max W. (Guest)
on 2009-01-15 16:27
After the (remote) delete action for my lesson_categories controller i
fall through to this js.rjs file:

page.visual_effect :fade, "lesson_category_#{@lesson_category.id}",
:duration => 1
page.remove "lesson_category_#{@lesson_category.id}"

The problem, though, is that the visual effect is initiated, then the
remove is initiated, before the visual effect is finished, so that the
visual effect doesn't get a chance to be seen.  Is there a way to set
this up so that the remove isn't called until the visual effect
finishes?  Normally i'd look for a callback but i can't work out how to
do it.

thanks
max
Frederick C. (Guest)
on 2009-01-15 16:50
(Received via mailing list)
On 15 Jan 2009, at 14:27, Max W. wrote:

> visual effect doesn't get a chance to be seen.  Is there a way to set
> this up so that the remove isn't called until the visual effect
> finishes?  Normally i'd look for a callback but i can't work out how
> to
> do it.

scriptaculous effects can have a bunch of options, including
afterFinish, but I think you'll need to write the javascript out by
hand to use those.#


Fred
This topic is locked and can not be replied to.