aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-09-12 17:09:46 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-10-19 11:06:29 +0200
commit361f008c705009eee8d7435f46095760ac706456 (patch)
tree95e7033befa4ff0fc20e60f5df2a4b249575d636 /apps/files/js
parent5e48ce98c70fa511ea2c1caeb332594912c9d96a (diff)
downloadnextcloud-server-361f008c705009eee8d7435f46095760ac706456.tar.gz
nextcloud-server-361f008c705009eee8d7435f46095760ac706456.zip
Make it possible to filter by tags with REPORT method
Enhanced the REPORT method on the Webdav endpoint and added a "oc:favorite" filter rule. When set, it will return a flat list of results filtered with only favorite files. The web UI was also adjusted to use this REPORT method instead of the private API endpoint. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/favoritesfilelist.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/files/js/favoritesfilelist.js b/apps/files/js/favoritesfilelist.js
index e6532ab188c..380689be10b 100644
--- a/apps/files/js/favoritesfilelist.js
+++ b/apps/files/js/favoritesfilelist.js
@@ -75,24 +75,25 @@ $(document).ready(function() {
// there is only root
this._setCurrentDir('/', false);
- this._reloadCall = $.ajax({
- url: OC.generateUrl('/apps/files/api/v1/tags/{tagName}/files', {tagName: tagName}),
- type: 'GET',
- dataType: 'json'
- });
+ this._reloadCall = this.filesClient.getFilteredFiles(
+ {
+ favorite: true
+ },
+ {
+ properties: this._getWebdavProperties()
+ }
+ );
var callBack = this.reloadCallback.bind(this);
return this._reloadCall.then(callBack, callBack);
},
- reloadCallback: function(result) {
- delete this._reloadCall;
- this.hideMask();
-
- if (result.files) {
- this.setFiles(result.files.sort(this._sortComparator));
- return true;
+ reloadCallback: function(status, result) {
+ if (result) {
+ // prepend empty dir info because original handler
+ result.unshift({});
}
- return false;
+
+ return OCA.Files.FileList.prototype.reloadCallback.call(this, status, result);
}
});