summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-12-01 12:17:56 +0100
committerGitHub <noreply@github.com>2016-12-01 12:17:56 +0100
commita87638c6ab6e3b14be6d6622b9df8f86ddc2ac05 (patch)
treeefac52307ce3467b80d8b3457e3c2d2d0f9b3a83 /apps/files_sharing
parent220452e9438062f8201ec27ec606f21908af12a6 (diff)
parent05b86faccc6d05f8696236be7bb3232a2ef4778e (diff)
downloadnextcloud-server-a87638c6ab6e3b14be6d6622b9df8f86ddc2ac05.tar.gz
nextcloud-server-a87638c6ab6e3b14be6d6622b9df8f86ddc2ac05.zip
Merge pull request #2371 from nextcloud/issue-2369-add-share-indicator-for-mail-shares
Add share indicator for mail shares
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/share.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 073cc77e5aa..01c2ccfb863 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -114,6 +114,8 @@
shareType = parseInt(shareType, 10);
if (shareType === OC.Share.SHARE_TYPE_LINK) {
hasLink = true;
+ } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
+ hasLink = true;
} else if (shareType === OC.Share.SHARE_TYPE_USER) {
hasShares = true;
} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {
@@ -159,8 +161,17 @@
shareTab.on('sharesChanged', function(shareModel) {
var fileInfoModel = shareModel.fileInfoModel;
var $tr = fileList.findFileEl(fileInfoModel.get('name'));
+
+ // We count email shares as link share
+ var hasLinkShare = shareModel.hasLinkShare();
+ shareModel.get('shares').forEach(function (share) {
+ if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) {
+ hasLinkShare = true;
+ }
+ });
+
OCA.Sharing.Util._updateFileListDataAttributes(fileList, $tr, shareModel);
- if (!OCA.Sharing.Util._updateFileActionIcon($tr, shareModel.hasUserShares(), shareModel.hasLinkShare())) {
+ if (!OCA.Sharing.Util._updateFileActionIcon($tr, shareModel.hasUserShares(), hasLinkShare)) {
// remove icon, if applicable
OC.Share.markFileAsShared($tr, false, false);
}