From 8133ca056cc99149ebcc40757080a2f22d608382 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 27 Jun 2019 12:14:27 +0200 Subject: [PATCH] Fix download link included in public share page with hidden download MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The preview element in the public share page was always wrapped with a link to download the file; now that link is included only if the "Hide download" option of the share is not enabled. Signed-off-by: Daniel Calviño Sánchez --- apps/files_sharing/js/public.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index d339ae1dcb4..e4a6bbd3ed1 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -136,9 +136,11 @@ OCA.Sharing.PublicApp = { scalingup: 0 }; - var imgcontainer = $(''); - var img = imgcontainer.find('.publicpreview'); + var imgcontainer = $(''); + if (hideDownload === 'false') { + imgcontainer = $('').append(imgcontainer); + } + var img = imgcontainer.hasClass('publicpreview')? imgcontainer: imgcontainer.find('.publicpreview'); img.css({ 'max-width': previewWidth, 'max-height': previewHeight -- 2.39.5