Fix hidpi previews on public page
This commit is contained in:
parent
90bd53c94e
commit
ee87f12c09
|
@ -90,12 +90,12 @@ OCA.Sharing.PublicApp = {
|
||||||
// dynamically load image previews
|
// dynamically load image previews
|
||||||
var token = $('#sharingToken').val();
|
var token = $('#sharingToken').val();
|
||||||
var bottomMargin = 350;
|
var bottomMargin = 350;
|
||||||
var previewWidth = Math.ceil($(window).width() * window.devicePixelRatio);
|
var previewWidth = $(window).width();
|
||||||
var previewHeight = Math.ceil(($(window).height() - bottomMargin) * window.devicePixelRatio);
|
var previewHeight = $(window).height() - bottomMargin;
|
||||||
previewHeight = Math.max(200, previewHeight);
|
previewHeight = Math.max(200, previewHeight);
|
||||||
var params = {
|
var params = {
|
||||||
x: previewWidth,
|
x: Math.ceil(previewWidth * window.devicePixelRatio),
|
||||||
y: previewHeight,
|
y: Math.ceil(previewHeight * window.devicePixelRatio),
|
||||||
a: 'true',
|
a: 'true',
|
||||||
file: encodeURIComponent(this.initialDir + $('#filename').val()),
|
file: encodeURIComponent(this.initialDir + $('#filename').val()),
|
||||||
t: token,
|
t: token,
|
||||||
|
@ -103,6 +103,10 @@ OCA.Sharing.PublicApp = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var img = $('<img class="publicpreview" alt="">');
|
var img = $('<img class="publicpreview" alt="">');
|
||||||
|
img.css({
|
||||||
|
'max-width': previewWidth,
|
||||||
|
'max-height': previewHeight
|
||||||
|
});
|
||||||
|
|
||||||
var fileSize = parseInt($('#filesize').val(), 10);
|
var fileSize = parseInt($('#filesize').val(), 10);
|
||||||
var maxGifSize = parseInt($('#maxSizeAnimateGif').val(), 10);
|
var maxGifSize = parseInt($('#maxSizeAnimateGif').val(), 10);
|
||||||
|
|
Loading…
Reference in New Issue