summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-07-20 16:51:28 +0200
committerOlivier Paroz <github@oparoz.com>2015-07-20 16:51:28 +0200
commit897e99ac588c6a19b280f2b948c75643786c41af (patch)
tree7cb995c9bf9b1edd91dd99a7bd6566a7e4f67caa /apps/files_sharing
parentf1df6cd4ff67fe9ad27e09dd5071f8ed2566fe36 (diff)
downloadnextcloud-server-897e99ac588c6a19b280f2b948c75643786c41af.tar.gz
nextcloud-server-897e99ac588c6a19b280f2b948c75643786c41af.zip
Fix preview of old file on public upload conflicts
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/public.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 5923e426f05..72e2005e4fd 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -158,9 +158,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);
};
@@ -292,15 +301,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);
};
}
});