diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-21 01:34:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-21 01:34:37 +0000 |
commit | 476f26ee908b9d42a08174aaa3ed39db041b54cd (patch) | |
tree | 04dd24eacc2f4d5845556a9cf13b289d43f8f3d8 | |
parent | 71dc36903af2fb8e4db68768659ad6251b96d24c (diff) | |
download | rails-476f26ee908b9d42a08174aaa3ed39db041b54cd.tar.gz rails-476f26ee908b9d42a08174aaa3ed39db041b54cd.tar.bz2 rails-476f26ee908b9d42a08174aaa3ed39db041b54cd.zip |
Renamed Toggle.visibility to Toggle.display and fixed it for multiple arguments
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_view/helpers/javascripts/prototype.js | 7 | ||||
-rw-r--r-- | railties/html/javascripts/prototype.js | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/prototype.js b/actionpack/lib/action_view/helpers/javascripts/prototype.js index ff105997c5..d71e878876 100644 --- a/actionpack/lib/action_view/helpers/javascripts/prototype.js +++ b/actionpack/lib/action_view/helpers/javascripts/prototype.js @@ -58,9 +58,10 @@ Try = { } Toggle = { - visibility: function() { - for (i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); + display: function() { + elements = $.apply(this, arguments); + for (var i = 0; i < elements.length; i++) { + element = elements[i]; element.style.display = (element.style.display == 'none' ? '' : 'none'); } diff --git a/railties/html/javascripts/prototype.js b/railties/html/javascripts/prototype.js index ff105997c5..d71e878876 100644 --- a/railties/html/javascripts/prototype.js +++ b/railties/html/javascripts/prototype.js @@ -58,9 +58,10 @@ Try = { } Toggle = { - visibility: function() { - for (i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); + display: function() { + elements = $.apply(this, arguments); + for (var i = 0; i < elements.length; i++) { + element = elements[i]; element.style.display = (element.style.display == 'none' ? '' : 'none'); } |