summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-04 11:45:36 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-04 11:45:36 +0200
commit59ca30d462f3b3a5703f203d2d4c3641c456e560 (patch)
tree35994bc6782c3eff03d38109209116ccd6397bbb /apps
parente4a3f8d3c44f3238071d03f793cd2c5395062b5e (diff)
downloadnextcloud-server-59ca30d462f3b3a5703f203d2d4c3641c456e560.tar.gz
nextcloud-server-59ca30d462f3b3a5703f203d2d4c3641c456e560.zip
Fix reload call for all subclasses
All subclasses must also properly return the ajax call object.
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js4
-rw-r--r--apps/files_external/js/mountsfilelist.js9
-rw-r--r--apps/files_sharing/js/sharedfilelist.js9
3 files changed, 7 insertions, 15 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 400e3e28f00..9c6d31ee017 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -919,7 +919,9 @@
.addClass(direction === 'desc' ? this.SORT_INDICATOR_DESC_CLASS : this.SORT_INDICATOR_ASC_CLASS);
},
/**
- * @brief Reloads the file list using ajax call
+ * Reloads the file list using ajax call
+ *
+ * @return ajax call object
*/
reload: function() {
this._selectedFiles = {};
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) {
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index 304f77a8d77..c6dc0a4c862 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -95,7 +95,6 @@
},
reload: function() {
- var self = this;
this.showMask();
if (this._reloadCall) {
this._reloadCall.abort();
@@ -110,14 +109,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) {