From a3b6f05722e95007736c9246fe60ae7abe54823e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Wed, 3 Jan 2018 09:17:14 +0100 Subject: [PATCH] Invert app icons on IE11 as well MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/templates/layout.user.php | 10 +++++++-- lib/private/TemplateLayout.php | 9 ++++++++ settings/js/apps.js | 41 +++++++++++++++++++--------------- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 50ed08761ae..0249ddd4ffb 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -66,8 +66,14 @@ class="active"> - + + + + + + <?php p($entry['name']); ?> + diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index f7bb23cd3de..dcc0fd3ba67 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -105,6 +105,15 @@ class TemplateLayout extends \OC_Template { $this->assign('userAvatarVersion', \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), 'avatar', 'version', 0)); } + // check if app menu icons should be inverted + try { + /** @var \OCA\Theming\Util $util */ + $util = \OC::$server->query(\OCA\Theming\Util::class); + $this->assign('themingInvertMenu', $util->invertTextColor(\OC::$server->getThemingDefaults()->getColorPrimary())); + } catch (\OCP\AppFramework\QueryException $e) { + $this->assign('themingInvertMenu', false); + } + } else if ($renderAs == 'error') { parent::__construct('core', 'layout.guest', '', false); $this->assign('bodyid', 'body-login'); diff --git a/settings/js/apps.js b/settings/js/apps.js index 278c307b1f3..350c29f5a69 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -631,24 +631,29 @@ OC.Settings.Apps = OC.Settings.Apps || { } if ($('#appmenu').children('li[data-id="' + entry.id + '"]').length === 0) { - var li = $('
  • '); - li.attr('data-id', entry.id); - var img = ''; - var a = $('').attr('href', entry.href); - var filename = $(''); - var loading = $('
    ').css('display', 'none'); - filename.text(entry.name); - a.prepend(filename); - a.prepend(loading); - a.prepend(img); - li.append(a); - $('#appmenu li[data-id='+ previousEntry.id+']').after(li); - if(addedApps[entry.id]) { - li.animate({opacity: 0.5}) - .animate({opacity: 1}) - .animate({opacity: 0.5}) - .animate({opacity: 1}); - } + var li = $('
  • '); + li.attr('data-id', entry.id); + var img = ''; + if (OCA.Theming && OCA.Theming.inverted) { + img = ''; + img += ''; + img += ''; + } + var a = $('').attr('href', entry.href); + var filename = $(''); + var loading = $('
    ').css('display', 'none'); + filename.text(entry.name); + a.prepend(filename); + a.prepend(loading); + a.prepend(img); + li.append(a); + $('#appmenu li[data-id='+ previousEntry.id+']').after(li); + if(addedApps[entry.id]) { + li.animate({opacity: 0.5}) + .animate({opacity: 1}) + .animate({opacity: 0.5}) + .animate({opacity: 1}); + } } previousEntry = entry; } -- 2.39.5