summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-07-20 16:51:28 +0200
committerGeorg Ehrke <developer@georgehrke.com>2015-09-20 12:38:21 +0200
commit04b14df35ca05e49194534a7c14ee2ab9199e4bb (patch)
tree28be4b928192164c746824cc8fe52738f492c211 /apps/files_sharing/js/public.js
parentbbd1e996050fee80795d0e656da98b6451232c6c (diff)
downloadnextcloud-server-04b14df35ca05e49194534a7c14ee2ab9199e4bb.tar.gz
nextcloud-server-04b14df35ca05e49194534a7c14ee2ab9199e4bb.zip
Fix preview of old file on public upload conflicts
Diffstat (limited to 'apps/files_sharing/js/public.js')
-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 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);
};
}
});