summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-06-27 12:14:27 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-06-27 12:21:34 +0200
commit443c1db3a34050b19dd83ef2214035bd14679279 (patch)
tree429539e79019f7eecaae2b01d4b29ca95efaf761
parentbb68f4c1de7d851d5823736dcedbee976eefa5da (diff)
downloadnextcloud-server-443c1db3a34050b19dd83ef2214035bd14679279.tar.gz
nextcloud-server-443c1db3a34050b19dd83ef2214035bd14679279.zip
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 <danxuliu@gmail.com>
-rw-r--r--apps/files_sharing/js/public.js8
1 files 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 = $('<a href="' + $('#previewURL').val()
- + '" target="_blank"><img class="publicpreview" alt=""></a>');
- var img = imgcontainer.find('.publicpreview');
+ var imgcontainer = $('<img class="publicpreview" alt="">');
+ if (hideDownload === 'false') {
+ imgcontainer = $('<a href="' + $('#previewURL').val() + '" target="_blank"></a>').append(imgcontainer);
+ }
+ var img = imgcontainer.hasClass('publicpreview')? imgcontainer: imgcontainer.find('.publicpreview');
img.css({
'max-width': previewWidth,
'max-height': previewHeight