[Pkg-owncloud-commits] [owncloud] 14/70: Fix reload call for all subclasses

David Prévot taffit at moszumanska.debian.org
Mon Jul 14 17:38:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 86545a90d0a02d1035c3940752cb635f35d8a9f3
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Jul 4 11:45:36 2014 +0200

    Fix reload call for all subclasses
    
    All subclasses must also properly return the ajax call object.
---
 apps/files/js/filelist.js                | 4 +++-
 apps/files_external/js/mountsfilelist.js | 9 ++-------
 apps/files_sharing/js/sharedfilelist.js  | 9 ++-------
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 400e3e2..9c6d31e 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 70b5b81..0f61f78 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 ea9071c..e643618 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list