Disable grid for ie

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-11-05 17:27:09 +01:00
parent 934d08b2e8
commit e0de0a122f
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
4 changed files with 17 additions and 2 deletions

View File

@ -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();

View File

@ -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">

View File

@ -196,6 +196,7 @@ body {
display: flex;
height: 36px;
width: 36px;
padding: 9px; // width - border - icon width = 18px
align-items: center;
justify-content: center;
}

View File

@ -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');