diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-24 15:20:00 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-24 15:20:00 +0200 |
commit | 846b8268672df2c626616fec5f71e15570005e84 (patch) | |
tree | e4f1f8ee1bc4866521dfe03dc239429b84540c24 /apps | |
parent | 30377e958f8a7a8aa15c62f2c3977349faf66ea1 (diff) | |
parent | 04b14df35ca05e49194534a7c14ee2ab9199e4bb (diff) | |
download | nextcloud-server-846b8268672df2c626616fec5f71e15570005e84.tar.gz nextcloud-server-846b8268672df2c626616fec5f71e15570005e84.zip |
Merge pull request #18517 from owncloud/17753_to_master
Fix preview of old file on public upload conflicts
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/public.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 1993efe7d73..4908968a937 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -159,9 +159,18 @@ OCA.Sharing.PublicApp = { }; this.fileList.generatePreviewUrl = function (urlSpec) { + urlSpec = urlSpec || {}; + if (!urlSpec.x) { + urlSpec.x = 36; + } + if (!urlSpec.y) { + urlSpec.y = 36; + } + urlSpec.x *= window.devicePixelRatio; + urlSpec.y *= window.devicePixelRatio; + urlSpec.x = Math.floor(urlSpec.x); + urlSpec.y = Math.floor(urlSpec.y); urlSpec.t = $('#dirToken').val(); - urlSpec.y = Math.floor(36 * window.devicePixelRatio); - urlSpec.x = Math.floor(36 * window.devicePixelRatio); return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec); }; @@ -293,15 +302,8 @@ $(document).ready(function () { if (window.Files) { // HACK: for oc-dialogs previews that depends on Files: - Files.lazyLoadPreview = function (path, mime, ready, width, height, etag) { - return App.fileList.lazyLoadPreview({ - path: path, - mime: mime, - callback: ready, - width: width, - height: height, - etag: etag - }); + Files.generatePreviewUrl = function (urlSpec) { + return App.fileList.generatePreviewUrl(urlSpec); }; } }); |