From c3ca5ab7a80702b63dc77748043f8a72ff1529a5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 17 Apr 2005 07:52:50 +0000 Subject: 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 --- .../lib/action_view/helpers/javascript_helper.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'actionpack/lib/action_view/helpers/javascript_helper.rb') diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 9e91cd189e..7e11e09c1d 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -95,16 +95,16 @@ module ActionView # Returns a button input tag that will submit form using XMLHttpRequest in tghe background instead of regular # reloading POST arrangement. options argument is the same as in form_remote_tag - def submit_to_remote(name,value,options = {}) - options[:with] = 'Form.serialize(this.form)' + def submit_to_remote(name, value, options = {}) + options[:with] = 'Form.serialize(this.form)' - options[:html] ||= {} - options[:html][:type] = 'button' - options[:html][:onclick] = "#{remote_function(options)}; return false;" - options[:html][:name] = name - options[:html][:value] = value - - tag("input", options[:html], false) + options[:html] ||= {} + options[:html][:type] = 'button' + options[:html][:onclick] = "#{remote_function(options)}; return false;" + options[:html][:name] = name + options[:html][:value] = value + + tag("input", options[:html], false) end def remote_function(options) #:nodoc: for now @@ -134,9 +134,7 @@ module ActionView # create remote ' end -- cgit v1.2.3