summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-07-04 16:13:33 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-07-04 16:13:33 +0200
commit574cb15c2dd90533870bed0e00d9f534d4643cb6 (patch)
treec1987569a02d41b14a296fad960832d06ff09aea /apps
parentaeeae5f1b2d2558fc6e49e64944396eca4a5f9b4 (diff)
parent59ca30d462f3b3a5703f203d2d4c3641c456e560 (diff)
downloadnextcloud-server-574cb15c2dd90533870bed0e00d9f534d4643cb6.tar.gz
nextcloud-server-574cb15c2dd90533870bed0e00d9f534d4643cb6.zip
Merge pull request #9434 from owncloud/files-reloadpromiseissue
Fix reload call for all subclasses
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 ea9071cfcb8..e643618e774 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) {