From fb8aa31dbf961d23f508eecf1cb44c7dbbac1d70 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 19 Nov 2018 14:19:42 +0100 Subject: Allow to hide download option for folders shared by link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/js/fileactions.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 5af558d77ba..10fedc88288 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -362,15 +362,17 @@ // remove previous $tr.find('.action-menu').remove(); - var $el = this._renderInlineAction({ - name: 'menu', - displayName: '', - iconClass: 'icon-more', - altText: t('files', 'Actions'), - action: this._showMenuClosure - }, false, context); - - $el.addClass('permanent'); + if (this.actions.length > 0) { + var $el = this._renderInlineAction({ + name: 'menu', + displayName: '', + iconClass: 'icon-more', + altText: t('files', 'Actions'), + action: this._showMenuClosure + }, false, context); + + $el.addClass('permanent'); + } }, /** -- cgit v1.2.3 From 78056a3bef15c04af19b256915415f413cb561f2 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 20 Nov 2018 12:20:06 +0100 Subject: Fix whitespace and file action cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/js/fileactions.js | 21 ++++++++++----------- apps/files_sharing/js/public.js | 3 ++- core/js/tests/specs/sharedialoglinkshareview.js | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 10fedc88288..2981fb64c11 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -362,17 +362,16 @@ // remove previous $tr.find('.action-menu').remove(); - if (this.actions.length > 0) { - var $el = this._renderInlineAction({ - name: 'menu', - displayName: '', - iconClass: 'icon-more', - altText: t('files', 'Actions'), - action: this._showMenuClosure - }, false, context); - - $el.addClass('permanent'); - } + var $el = this._renderInlineAction({ + name: 'menu', + displayName: '', + iconClass: 'icon-more', + altText: t('files', 'Actions'), + action: this._showMenuClosure + }, false, context); + + $el.addClass('permanent'); + }, /** diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 57001c495d3..d339ae1dcb4 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -209,7 +209,7 @@ OCA.Sharing.PublicApp = { // Remove the link. This means that files without a default action fail hard $tr.find('a.name').attr('href', '#'); - delete this.fileActions.actions.all.Download; + this.fileActions.actions.all = {}; } return $tr; }; @@ -299,6 +299,7 @@ OCA.Sharing.PublicApp = { if (hideDownload === 'true') { this.fileList.$el.find('#headerSelection').remove(); + this.fileList.$el.find('.summary').find('td:first-child').remove(); } } diff --git a/core/js/tests/specs/sharedialoglinkshareview.js b/core/js/tests/specs/sharedialoglinkshareview.js index 0272b07297e..9e6c67dca14 100644 --- a/core/js/tests/specs/sharedialoglinkshareview.js +++ b/core/js/tests/specs/sharedialoglinkshareview.js @@ -114,7 +114,7 @@ describe('OC.Share.ShareDialogLinkShareView', function () { $hideDownloadCheckbox = view.$el.find('.hideDownloadCheckbox'); - expect($hideDownloadCheckbox.length).toBeFalsy(); + expect($hideDownloadCheckbox.length).toBeTruthy(); }); it('checkbox is checked when the setting is enabled', function () { -- cgit v1.2.3