From 05b86faccc6d05f8696236be7bb3232a2ef4778e Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 30 Nov 2016 09:35:38 +0100 Subject: [PATCH] Display link share icon when toggling share Signed-off-by: Roeland Jago Douma --- apps/files_sharing/js/share.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index a40d40e6b8a..01c2ccfb863 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -161,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); } -- 2.39.5