Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-06-27 17:28:41 +0300
committerGitHub <noreply@github.com>2019-06-27 17:28:41 +0300
commitf7ea09a0ff9879cb6f5c83869f0c65b954696fe2 (patch)
tree5dc47df3aa5a98344bcff2f61c2b7296971874be
parentc63f1d8d39f0ccae4483c6c37a1ecf7fa9040b81 (diff)
parenta8323bbc0536ee82b9f7d852a34bf266125d2033 (diff)
Merge pull request #16118 from nextcloud/fix-placement-of-icon-in-public-share-page-for-audio-files
Fix placement of icon in public share page for audio files
-rw-r--r--apps/files_sharing/css/public.scss6
-rw-r--r--apps/files_sharing/js/public.js13
2 files changed, 15 insertions, 4 deletions
diff --git a/apps/files_sharing/css/public.scss b/apps/files_sharing/css/public.scss
index f0f367d5596..a8207167c2c 100644
--- a/apps/files_sharing/css/public.scss
+++ b/apps/files_sharing/css/public.scss
@@ -25,6 +25,12 @@
max-width: 100% !important;
}
+#imgframe audio {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
#imgframe .text-preview {
display: inline-block;
position: relative;
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 08b7af356f3..b4f76ca0678 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
@@ -175,7 +177,10 @@ OCA.Sharing.PublicApp = {
} else if (mimetype.substr(0, mimetype.indexOf('/')) !== 'video') {
img.attr('src', mimetypeIcon);
img.attr('width', 128);
- imgcontainer.appendTo('#imgframe');
+ // "#imgframe" is either empty or it contains an audio preview that
+ // the icon should appear before, so the container should be
+ // prepended to the frame.
+ imgcontainer.prependTo('#imgframe');
}
else if (previewSupported === 'true') {
$('#imgframe > video').attr('poster', OC.generateUrl('/apps/files_sharing/publicpreview/' + token + '?' + OC.buildQueryString(params)));