diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-06-02 15:59:06 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-06-02 15:59:06 +0200 |
commit | d677e3860d22e3a779c0f01af1adc4e193127d1c (patch) | |
tree | e666f6a708b95e25ec13e25971cc0c1b15a71a07 /apps/files_sharing/js/sharedfilelist.js | |
parent | 7961d4a87e8734bbcfda98309e6b64797fc0bb42 (diff) | |
download | nextcloud-server-d677e3860d22e3a779c0f01af1adc4e193127d1c.tar.gz nextcloud-server-d677e3860d22e3a779c0f01af1adc4e193127d1c.zip |
Added unit tests for share.js and share icon
Diffstat (limited to 'apps/files_sharing/js/sharedfilelist.js')
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 9cf74abf670..8a6c3169f9e 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -48,9 +48,6 @@ if (this._sharedWithUser) { $tr.attr('data-share-owner', fileData.shares[0].ownerDisplayName); } - if (fileData.recipientsDisplayName) { - $tr.attr('data-share-recipients', fileData.recipientsDisplayName); - } return $tr; }, @@ -201,11 +198,9 @@ data.shares.push(file.share); } - if (file.share.type === OC.Share.SHARE_TYPE_LINK) { - data.hasLinkShare = true; - } else if (recipient) { + if (recipient) { // limit counterparts for output - if (data.recipientsCount < 3) { + if (data.recipientsCount < 4) { // only store the first ones, they will be the only ones // displayed data.recipients[recipient] = true; @@ -222,11 +217,7 @@ .each(function(data) { // convert the recipients map to a flat // array of sorted names - data.recipients = _.chain(data.recipients).keys().sort().value(); - if (data.hasLinkShare) { - data.recipients.unshift(t('files_sharing', 'Public')); - delete data.hasLinkShare; - } + data.recipients = _.keys(data.recipients); data.recipientsDisplayName = OCA.Sharing.Util.formatRecipients( data.recipients, data.recipientsCount |