Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #541 from owncloud/stable8.1-ask-for-preview-provider
Browse files Browse the repository at this point in the history
[stable8.1] Load previews only for registered providers
  • Loading branch information
VicDeo committed Aug 31, 2015
2 parents 399ef2c + 871f084 commit f31447e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion controller/documentcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public function listAll(){
} else {
$documents[$key] = $document;
}
$documents[$key]['icon'] = preg_replace('/\.png$/', '.svg', \OC_Helper::mimetypeIcon($document['mimetype']));
$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'];
}

Expand Down
2 changes: 1 addition & 1 deletion js/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit f31447e

Please sign in to comment.