diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-14 18:01:44 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-21 08:14:16 +0100 |
commit | 4ad922d4f6ea7f08c54223587964bb93ae064ce5 (patch) | |
tree | 25302403d16af2fbea98d47129408cd13776d7d4 /apps/files_sharing/src | |
parent | 6ea5beccd7f74bb13fdec02b5720e1ef2a5652f2 (diff) | |
download | nextcloud-server-4ad922d4f6ea7f08c54223587964bb93ae064ce5.tar.gz nextcloud-server-4ad922d4f6ea7f08c54223587964bb93ae064ce5.zip |
Show sharing in menu in grid view
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/share.js | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/files_sharing/src/share.js b/apps/files_sharing/src/share.js index b02c6e3d9ee..f253dcb2db9 100644 --- a/apps/files_sharing/src/share.js +++ b/apps/files_sharing/src/share.js @@ -162,11 +162,33 @@ fileActions.registerAction({ name: 'Share', - displayName: '', + displayName: function(context) { + if (context && context.$file) { + var shareType = parseInt(context.$file.data('share-types'), 10) + var shareOwner = context.$file.data('share-owner-id') + if (shareType >= 0 || shareOwner) { + return t('core', 'Shared') + } + } + return t('core', 'Share') + }, altText: t('core', 'Share'), mime: 'all', + order: -60, permissions: OC.PERMISSION_ALL, - iconClass: 'icon-shared', + iconClass: function(fileName, context) { + var shareType = parseInt(context.$file.data('share-types'), 10) + if (shareType === OC.Share.SHARE_TYPE_EMAIL) { + return 'icon-public' + } + return 'icon-shared' + }, + icon: function(fileName, context) { + var shareOwner = context.$file.data('share-owner-id') + if (shareOwner) { + return OC.generateUrl(`/avatar/${shareOwner}/32`) + } + }, type: OCA.Files.FileActions.TYPE_INLINE, actionHandler: function(fileName, context) { // do not open sidebar if permission is set and equal to 0 |