Do not load previews when they are disabled. Ref #425

pull/1/head
Victor Dubiniuk 9 years ago
parent 4865408bb4
commit 453d6760fb

@ -41,11 +41,12 @@ namespace OCA\Documents;
$tmpl = new \OCP\Template('documents', 'documents', 'user');
$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', false);
$unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false');
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
$savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/');
$tmpl->assign('enable_previews', $previewsEnabled);
$tmpl->assign('useUnstable', $unstable);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));

@ -70,7 +70,9 @@ $.widget('oc.documentGrid', {
}(a);
ready(previewURL);
};
img.src = previewURL;
if ( $('#previews_enabled').length ) {
img.src = previewURL;
}
},
_load : function (){

@ -35,4 +35,7 @@
</ul>
</div>
<input type="hidden" id="webodf-unstable" value="<?php p($_['useUnstable']) ?>" />
<?php if ($_['enable_previews']): ?>
<input type="hidden" id="previews_enabled" value="<?php p($_['enable_previews']) ?>" />
<?php endif; ?>
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />

Loading…
Cancel
Save