diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-14 15:56:46 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-14 15:56:46 +0000 |
commit | 971fa4cd364d86bc5e999520517e85804c5a6d58 (patch) | |
tree | 6777cab628979db3b417aa4d60e994e83dee7c31 | |
parent | 0c0a10746f1996c5ed09063cdd74fc5bdbd0c1fe (diff) | |
download | rails-971fa4cd364d86bc5e999520517e85804c5a6d58.tar.gz rails-971fa4cd364d86bc5e999520517e85804c5a6d58.tar.bz2 rails-971fa4cd364d86bc5e999520517e85804c5a6d58.zip |
Made async callbacks work with :update
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@904 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 6ce1d05e2c..619ce94341 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -96,12 +96,16 @@ module ActionView var url = arguments[1]; var parameters = arguments[2]; var async = arguments[3]; + var callbacks = arguments[4]; if (async) { - xml_request(url, parameters, true, - { complete: function(request) { - container.innerHTML = request.responseText } - }) + if(!callbacks) callbacks = {} + complete = callbacks['complete'] + callbacks['complete'] = function(request) { + container.innerHTML = request.responseText + if(complete) complete(request) + } + xml_request(url, parameters, true, callbacks) } else { container.innerHTML = xml_request(url, parameters); } |