diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-22 14:20:48 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-22 14:20:48 -0700 |
commit | cea1f80c1a124d7963568bd095f1dbbaf7fd0a39 (patch) | |
tree | 4b6ace02e7b24d49206490cb6d6f50f9fda1b0af /apps | |
parent | e6aa7a8643517755387ca4738cee6e45313449ae (diff) | |
parent | 3bb7cf939ec56f97a5fb01c16282ed7d831e338f (diff) | |
download | nextcloud-server-cea1f80c1a124d7963568bd095f1dbbaf7fd0a39.tar.gz nextcloud-server-cea1f80c1a124d7963568bd095f1dbbaf7fd0a39.zip |
Merge pull request #5466 from owncloud/files-thumbnailloadingdelaystyle
Fixed ugly white space while loading file thumbnail
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/files.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index c3a8d81b50d..ec2dc7c62ea 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -663,8 +663,16 @@ function lazyLoadPreview(path, mime, ready, width, height) { $.get(previewURL, function() { previewURL = previewURL.replace('(', '%28'); previewURL = previewURL.replace(')', '%29'); - //set preview thumbnail URL - ready(previewURL + '&reload=true'); + previewURL += '&reload=true'; + + // preload image to prevent delay + // this will make the browser cache the image + var img = new Image(); + img.onload = function(){ + //set preview thumbnail URL + ready(previewURL); + } + img.src = previewURL; }); }); } |