Changed API for action proxy's failure method
authorAlexander Ebert <ebert@woltlab.com>
Wed, 27 Feb 2013 01:12:18 +0000 (02:12 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 27 Feb 2013 01:12:18 +0000 (02:12 +0100)
wcfsetup/install/files/js/WCF.js

index af4d4139c11610391a5e2473c0f42354bcedbdec..3b17ea4a196ab35737bcc8552d494fbde7a8a63b 100755 (executable)
@@ -1544,12 +1544,12 @@ WCF.Action.Proxy = Class.extend({
         */
        _failure: function(jqXHR, textStatus, errorThrown) {
                try {
-                       var data = $.parseJSON(jqXHR.responseText);
+                       var $data = $.parseJSON(jqXHR.responseText);
                        
                        // call child method if applicable
                        var $showError = true;
                        if ($.isFunction(this.options.failure)) {
-                               $showError = this.options.failure(jqXHR, textStatus, errorThrown, jqXHR.responseText);
+                               $showError = this.options.failure($data, jqXHR, textStatus, errorThrown);
                        }
                        
                        if (!this._suppressErrors && $showError !== false) {
@@ -1561,7 +1561,7 @@ WCF.Action.Proxy = Class.extend({
                        // call child method if applicable
                        var $showError = true;
                        if ($.isFunction(this.options.failure)) {
-                               $showError = this.options.failure(jqXHR, textStatus, errorThrown, jqXHR.responseText);
+                               $showError = this.options.failure(null, jqXHR, textStatus, errorThrown);
                        }
                        
                        if (!this._suppressErrors && $showError !== false) {