Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>tags/v15.0.0beta1
@@ -26,10 +26,13 @@ $userSession = \OC::$server->getUserSession(); | |||
// TODO: move this to the generated config.js | |||
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); | |||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true); | |||
$isIE = \OCP\Util::isIE(); | |||
// renders the controls and table headers template | |||
$tmpl = new OCP\Template('files', 'list', ''); | |||
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); | |||
$tmpl->assign('showgridview', $showgridview); | |||
// gridview not available for ie | |||
$tmpl->assign('showgridview', $showgridview && !$isIE); | |||
$tmpl->assign('isIE', $isIE); | |||
$tmpl->printPage(); | |||
@@ -24,10 +24,13 @@ | |||
<?php endif;?> | |||
<input type="hidden" class="max_human_file_size" | |||
value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)"> | |||
<!-- IF NOT IE, SHOW GRIDVIEW --> | |||
<?php if (!$_['isIE']) { ?> | |||
<input type="checkbox" class="hidden-visually" id="showgridview" | |||
<?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/> | |||
<label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>" | |||
title="<?php p($l->t('Toggle grid view'))?>"></label> | |||
<?php } ?> | |||
</div> | |||
<div id="emptycontent" class="hidden"> |
@@ -196,6 +196,7 @@ body { | |||
display: flex; | |||
height: 36px; | |||
width: 36px; | |||
padding: 9px; // width - border - icon width = 18px | |||
align-items: center; | |||
justify-content: center; | |||
} |
@@ -236,12 +236,20 @@ var OCdialogs = { | |||
multiselect = false; | |||
} | |||
// No grid for IE! | |||
if (OC.Util.isIE()) { | |||
self.$filePicker.find('#picker-view-toggle').remove(); | |||
self.$filePicker.find('#filestable').removeClass('view-grid'); | |||
} | |||
$('body').append(self.$filePicker); | |||
self.$showGridView = $('input#picker-showgridview'); | |||
self.$showGridView.on('change', _.bind(self._onGridviewChange, self)); | |||
self._getGridSettings(); | |||
if (!OC.Util.isIE()) { | |||
self._getGridSettings(); | |||
} | |||
self.$filePicker.ready(function() { | |||
self.$filelist = self.$filePicker.find('.filelist tbody'); |