diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-13 17:01:59 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-13 17:01:59 +0000 |
commit | 66ed733ce5abf64a0650e4359f1dff88c2dfd1b4 (patch) | |
tree | 0d6270f1d09a0c1eda3a45da8360d7e813c4304f /actionpack/lib | |
parent | 1e24600e724fc1971d85a1734528b14444f58895 (diff) | |
download | rails-66ed733ce5abf64a0650e4359f1dff88c2dfd1b4.tar.gz rails-66ed733ce5abf64a0650e4359f1dff88c2dfd1b4.tar.bz2 rails-66ed733ce5abf64a0650e4359f1dff88c2dfd1b4.zip |
Added Field.present, .focus, and .clear as JS convenience for working with forms. Removed link_to_display_toggle in favor of link_to_function "Cancel", "toggle_display("add_item_link", "add_item_form")"
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 05dd8b6bb3..bd22ffb0c0 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -4,21 +4,6 @@ module ActionView module Helpers # You must call <%= define_javascript_functions %> in your application before using these helpers. module JavascriptHelper - # Returns a link that'll toggle the visibility of the DOM objects which ids are mentioned in +tags+. If they're visible, we hide them, - # and vice versa. This is particularly useful for hiding and showing input and edit forms on in-page elements. - # - # Examples: - # link_to_toggle_display "Toggle controls", "control_box" - # link_to_toggle_display "Add note", %w( add_link add_form ) - def link_to_toggle_display(name, tags, html_options = {}) - html_options.symbolize_keys! - toggle_functions = [ tags ].flatten.collect { |tag| "toggle_display_by_id('#{tag}'); " }.join - content_tag( - "a", name, - html_options.merge(:href => "#", :onclick => "#{toggle_functions}#{html_options[:onclick]}; return false;") - ) - end - # Returns a link that'll trigger a javascript +function+ using the onclick handler and return false after the fact. # # Examples: |