Use second argument of bind in Upload.js
authorMatthias Schmidt <gravatronics@live.com>
Mon, 28 Sep 2015 15:15:28 +0000 (17:15 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 28 Sep 2015 15:15:28 +0000 (17:15 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Upload.js

index d6123dd0c30a709111baced3ce5ec16697f82f75..07f0ba0fe4fe6c9e795eb54c70ac896916614042 100644 (file)
@@ -306,15 +306,9 @@ define(['AjaxRequest', 'Core', 'Dom/ChangeListener', 'Language', 'Dom/Util'], fu
                        var request = new AjaxRequest({
                                data: formData,
                                contentType: false,
-                               failure: function(data, responseText, xhr, requestOptions) {
-                                       this._failure(uploadId, data, responseText, xhr, options.data);
-                               }.bind(this),
-                               success: function(data, responseText, xhr, requestOptions) {
-                                       this._success(uploadId, data, responseText, xhr, requestOptions);
-                               }.bind(this),
-                               uploadProgress: (function(event) {
-                                       this._progress(uploadId, event);
-                               }).bind(this),
+                               failure: this._failure.bind(this, uploadId),
+                               success: this._success.bind(this, uploadId),
+                               uploadProgress: this._progress.bind(this, uploadId),
                                url: this._options.url
                        });
                        request.sendRequest();