mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixed bug with :success/:failure callbacks for the JavaScriptHelper methods #1730 [court3nay/Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1835 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -17,7 +17,7 @@ module ActionView
|
||||
module JavaScriptHelper
|
||||
unless const_defined? :CALLBACKS
|
||||
CALLBACKS =
|
||||
[:uninitialized, :loading, :loaded, :interactive, :complete, :failure].push((100..599).to_a).flatten
|
||||
[:uninitialized, :loading, :loaded, :interactive, :complete, :failure, :success].push((100..599).to_a).flatten
|
||||
AJAX_OPTIONS = [ :before, :after, :condition, :url, :asynchronous, :method,
|
||||
:insertion, :position, :form, :with, :update, :script ].concat(CALLBACKS)
|
||||
JAVASCRIPT_PATH = File.join(File.dirname(__FILE__), 'javascripts')
|
||||
|
||||
@@ -268,7 +268,7 @@ Ajax.Request.prototype = (new Ajax.Base()).extend({
|
||||
|
||||
if (event == 'Complete')
|
||||
(this.options['on' + this.transport.status]
|
||||
|| this.options['on' + this.responseIsSuccess() ? 'Success' : 'Failure']
|
||||
|| this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
|
||||
|| Prototype.emptyFunction)(this.transport);
|
||||
|
||||
(this.options['on' + event] || Prototype.emptyFunction)(this.transport);
|
||||
|
||||
Reference in New Issue
Block a user