summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-06-27 22:13:54 +0200
committerGitHub <noreply@github.com>2019-06-27 22:13:54 +0200
commit1697f3472e72b2d723fd998e8d653250654f75ae (patch)
tree2a807a2e8bd1c6d67795f545d02e00c3b56664f9
parent843fcef3fd7891043a2b0038879e5480ad177119 (diff)
parent8133ca056cc99149ebcc40757080a2f22d608382 (diff)
downloadnextcloud-server-1697f3472e72b2d723fd998e8d653250654f75ae.tar.gz
nextcloud-server-1697f3472e72b2d723fd998e8d653250654f75ae.zip
Merge pull request #16126 from nextcloud/backport/16114/stable15
[stable15] Fix download link included in public share page with hidden download
-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 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 = $('<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