From: Daniel Calviño Sánchez Date: Thu, 27 Jun 2019 10:14:27 +0000 (+0200) Subject: Fix download link included in public share page with hidden download X-Git-Tag: v16.0.2RC1~6^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=88139907ddfe4861816e71109cba4c7e8a7521f9;p=nextcloud-server.git Fix download link included in public share page with hidden download 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 --- 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