Merge pull request #12289 from nextcloud/ie11-grid-disable

Disable grid for ie
This commit is contained in:
Roeland Jago Douma 2018-11-05 22:48:24 +01:00 committed by GitHub
commit cd31bea2b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 // TODO: move this to the generated config.js
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); $publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true); $showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
$isIE = \OCP\Util::isIE();
// renders the controls and table headers template // renders the controls and table headers template
$tmpl = new OCP\Template('files', 'list', ''); $tmpl = new OCP\Template('files', 'list', '');
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->assign('showgridview', $showgridview); // gridview not available for ie
$tmpl->assign('showgridview', $showgridview && !$isIE);
$tmpl->assign('isIE', $isIE);
$tmpl->printPage(); $tmpl->printPage();

View File

@ -24,10 +24,13 @@
<?php endif;?> <?php endif;?>
<input type="hidden" class="max_human_file_size" <input type="hidden" class="max_human_file_size"
value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)"> value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)">
<!-- IF NOT IE, SHOW GRIDVIEW -->
<?php if (!$_['isIE']) { ?>
<input type="checkbox" class="hidden-visually" id="showgridview" <input type="checkbox" class="hidden-visually" id="showgridview"
<?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/> <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/>
<label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>" <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> title="<?php p($l->t('Toggle grid view'))?>"></label>
<?php } ?>
</div> </div>
<div id="emptycontent" class="hidden"> <div id="emptycontent" class="hidden">

View File

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

View File

@ -236,12 +236,20 @@ var OCdialogs = {
multiselect = false; 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); $('body').append(self.$filePicker);
self.$showGridView = $('input#picker-showgridview'); self.$showGridView = $('input#picker-showgridview');
self.$showGridView.on('change', _.bind(self._onGridviewChange, self)); self.$showGridView.on('change', _.bind(self._onGridviewChange, self));
self._getGridSettings(); if (!OC.Util.isIE()) {
self._getGridSettings();
}
self.$filePicker.ready(function() { self.$filePicker.ready(function() {
self.$filelist = self.$filePicker.find('.filelist tbody'); self.$filelist = self.$filePicker.find('.filelist tbody');