From 443c1db3a34050b19dd83ef2214035bd14679279 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Thu, 27 Jun 2019 12:14:27 +0200 Subject: Fix download link included in public share page with hidden download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 08b7af356f3..fe59f2ce523 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 -- cgit v1.2.3