From f9816611959cc550952967bde4c4f2110d3507b9 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 30 Mar 2016 18:09:02 +0200 Subject: [PATCH] Fix displaying owner before share icon in file list Initial display of owner was missing --- apps/files_sharing/js/share.js | 5 +++-- apps/files_sharing/tests/js/shareSpec.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index a253763389..5bfc8e1d4a 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -111,8 +111,9 @@ _.each($files, function(file) { var $tr = $(file); - var shareTypes = $tr.attr('data-share-types'); - if (shareTypes) { + var shareTypes = $tr.attr('data-share-types') || ''; + var shareOwner = $tr.attr('data-share-owner'); + if (shareTypes || shareOwner) { var hasLink = false; var hasShares = false; _.each(shareTypes.split(',') || [], function(shareType) { diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index c488bd94fa..c34234bfe1 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -141,7 +141,7 @@ describe('OCA.Sharing.Util tests', function() { permissions: OC.PERMISSION_ALL, shareOwner: 'User One', etag: 'abc', - shareTypes: [OC.Share.SHARE_TYPE_USER] + shareTypes: [] }]); $tr = fileList.$el.find('tbody tr:first'); $action = $tr.find('.action-share');