Merge pull request #5466 from owncloud/files-thumbnailloadingdelaystyle
Fixed ugly white space while loading file thumbnail
This commit is contained in:
commit
cea1f80c1a
1 changed files with 10 additions and 2 deletions
|
@ -663,8 +663,16 @@ function lazyLoadPreview(path, mime, ready, width, height) {
|
|||
$.get(previewURL, function() {
|
||||
previewURL = previewURL.replace('(', '%28');
|
||||
previewURL = previewURL.replace(')', '%29');
|
||||
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 + '&reload=true');
|
||||
ready(previewURL);
|
||||
}
|
||||
img.src = previewURL;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue