Merge pull request #5466 from owncloud/files-thumbnailloadingdelaystyle

Fixed ugly white space while loading file thumbnail
This commit is contained in:
Thomas Müller 2013-10-22 14:20:48 -07:00
commit cea1f80c1a

View file

@ -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;
});
});
}