diff --git a/index.php b/index.php index 733a6fee..b62231ca 100644 --- a/index.php +++ b/index.php @@ -41,7 +41,7 @@ namespace OCA\Documents; $tmpl = new \OCP\Template('documents', 'documents', 'user'); -$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', false); +$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', true); $unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false'); $maxUploadFilesize = \OCP\Util::maxUploadFilesize("/"); $savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/'); diff --git a/js/documents.js b/js/documents.js index 49512efd..bd6b6357 100644 --- a/js/documents.js +++ b/js/documents.js @@ -60,17 +60,17 @@ $.widget('oc.documentGrid', { previewURL = OC.generateUrl('/core/preview.png?') + $.param(urlSpec); previewURL = previewURL.replace('(', '%28').replace(')', '%29'); - - var img = new Image(); - img.onload = function(){ - var ready = function (node){ - return function(path){ - node.css('background-image', 'url("'+ path +'")'); - }; - }(a); - ready(previewURL); - }; + if ( $('#previews_enabled').length ) { + var img = new Image(); + img.onload = function(){ + var ready = function (node){ + return function(path){ + node.css('background-image', 'url("'+ path +'")'); + }; + }(a); + ready(previewURL); + }; img.src = previewURL; } },