diff options
Diffstat (limited to 'apps/files_sharing/js/sharedfilelist.js')
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index ef1034ecfdc..fa39ded3c3e 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -26,6 +26,7 @@ * the files that the user shared with others (false). */ _sharedWithUser: false, + _linksOnly: false, initialize: function($el, options) { OCA.Files.FileList.prototype.initialize.apply(this, arguments); @@ -33,9 +34,13 @@ return; } + // TODO: consolidate both options if (options && options.sharedWithUser) { this._sharedWithUser = true; } + if (options && options.linksOnly) { + this._linksOnly = true; + } }, _createRow: function(fileData) { @@ -130,12 +135,20 @@ * @return array of file info maps */ _makeFilesFromShares: function(data) { + /* jshint camelcase: false */ var self = this; + var files = data; + + if (this._linksOnly) { + files = _.filter(data, function(share) { + return share.share_type === OC.Share.SHARE_TYPE_LINK; + }); + } + // OCS API uses non-camelcased names - var files = _.chain(data) + files = _.chain(files) // convert share data to file data .map(function(share) { - /* jshint camelcase: false */ var file = { id: share.file_source, mimetype: share.mimetype |