From 59ca30d462f3b3a5703f203d2d4c3641c456e560 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 4 Jul 2014 11:45:36 +0200 Subject: Fix reload call for all subclasses All subclasses must also properly return the ajax call object. --- apps/files_external/js/mountsfilelist.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'apps/files_external/js') diff --git a/apps/files_external/js/mountsfilelist.js b/apps/files_external/js/mountsfilelist.js index 70b5b81e65b..0f61f78aac8 100644 --- a/apps/files_external/js/mountsfilelist.js +++ b/apps/files_external/js/mountsfilelist.js @@ -65,7 +65,6 @@ }, reload: function() { - var self = this; this.showMask(); if (this._reloadCall) { this._reloadCall.abort(); @@ -78,14 +77,10 @@ type: 'GET', beforeSend: function(xhr) { xhr.setRequestHeader('OCS-APIREQUEST', 'true'); - }, - error: function(result) { - self.reloadCallback(result); - }, - success: function(result) { - self.reloadCallback(result); } }); + var callBack = this.reloadCallback.bind(this); + return this._reloadCall.then(callBack, callBack); }, reloadCallback: function(result) { -- cgit v1.2.3