Browse Source

Disable grid for ie

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
tags/v15.0.0beta1
John Molakvoæ (skjnldsv) 5 years ago
parent
commit
e0de0a122f
No account linked to committer's email address
4 changed files with 17 additions and 2 deletions
  1. 4
    1
      apps/files/list.php
  2. 3
    0
      apps/files/templates/list.php
  3. 1
    0
      core/css/styles.scss
  4. 9
    1
      core/js/oc-dialogs.js

+ 4
- 1
apps/files/list.php 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();


+ 3
- 0
apps/files/templates/list.php 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">

+ 1
- 0
core/css/styles.scss 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;
}

+ 9
- 1
core/js/oc-dialogs.js 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');

Loading…
Cancel
Save