diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-17 07:52:50 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-17 07:52:50 +0000 |
commit | c3ca5ab7a80702b63dc77748043f8a72ff1529a5 (patch) | |
tree | 263f39f3710d6f384d10a281d521fce69c219fb7 /railties/html/javascripts | |
parent | 6acda705dcee10cb31aae5ab8f6442f8006e4b37 (diff) | |
download | rails-c3ca5ab7a80702b63dc77748043f8a72ff1529a5.tar.gz rails-c3ca5ab7a80702b63dc77748043f8a72ff1529a5.tar.bz2 rails-c3ca5ab7a80702b63dc77748043f8a72ff1529a5.zip |
Added Element.toggle, Element.show, and Element.hide to the prototype javascript library. Toggle.display has been deprecated, but will still work #992 [Lucas Carlson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/html/javascripts')
-rw-r--r-- | railties/html/javascripts/prototype.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/railties/html/javascripts/prototype.js b/railties/html/javascripts/prototype.js index 1ab50882c4..c3e373cd64 100644 --- a/railties/html/javascripts/prototype.js +++ b/railties/html/javascripts/prototype.js @@ -1,4 +1,4 @@ -/* Prototype: an object-oriented Javascript library, version 1.0.1 +/* Prototype: an object-oriented Javascript library, version 1.1.0 * (c) 2005 Sam Stephenson <sam@conio.net> * * Prototype is freely distributable under the terms of an MIT-style license. @@ -62,14 +62,29 @@ var Try = { } } -var Toggle = { - display: function() { +// Deprecated accessor for Element.toggle +var Toggle = { display: function() { Element.toggle(arguments); } } + +var Element = { + toggle: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); element.style.display = (element.style.display == 'none' ? '' : 'none'); } } + hide: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = 'none'; + } + } + show: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = ''; + } + } } /*--------------------------------------------------------------------------*/ |