From 71dcc6982e7dcf29675cd3871523e6bdb9cd05a3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 20 Dec 2005 23:25:05 +0000 Subject: Added toggle to compliment show and hide for RJS git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/prototype_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 89d9ea7f2d..f1e67f05f4 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -454,6 +454,11 @@ module ActionView call 'Element.hide', *ids end + # Toggles the visibility of the DOM elements with the given +ids+. + def toggle(*ids) + call 'Element.toggle', *ids + end + # Displays an alert dialog with the given +message+. def alert(message) call 'alert', message -- cgit v1.2.3