Load previews only for registered providers

This commit is contained in:
Victor Dubiniuk 2015-08-28 20:49:50 +03:00
parent dfc91185f0
commit 89892137f0
2 changed files with 2 additions and 1 deletions

View File

@ -169,6 +169,7 @@ class DocumentController extends Controller{
$documents[$key] = $document;
}
$documents[$key]['icon'] = preg_replace('/\.png$/', '.svg', \OCP\Template::mimetype_icon($document['mimetype']));
$documents[$key]['hasPreview'] = \OC::$server->getPreviewManager()->isMimeSupported($document['mimetype']);
$fileIds[] = $document['fileid'];
}

View File

@ -61,7 +61,7 @@ $.widget('oc.documentGrid', {
previewURL = OC.generateUrl('/core/preview.png?') + $.param(urlSpec);
previewURL = previewURL.replace('(', '%28').replace(')', '%29');
if ( $('#previews_enabled').length ) {
if ( $('#previews_enabled').length && document.hasPreview) {
var img = new Image();
img.onload = function(){
var ready = function (node){