From e3e4cb3e67fb4d1399b4a9cf229633144008fdcf Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Wed, 11 Jan 2017 12:34:49 +0100 Subject: Move active app to the first slot Signed-off-by: Julius Haertl --- lib/private/legacy/app.php | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'lib/private/legacy') diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index f89f32f069a..264e8f5fc60 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -529,15 +529,7 @@ class OC_App { // This is private as well. It simply works, so don't ask for more details private static function proceedNavigation($list) { - $activeApp = OC::$server->getNavigationManager()->getActiveEntry(); - foreach ($list as &$navEntry) { - if ($navEntry['id'] == $activeApp) { - $navEntry['active'] = true; - } else { - $navEntry['active'] = false; - } - } - unset($navEntry); + usort($list, function($a, $b) { if (isset($a['order']) && isset($b['order'])) { @@ -549,6 +541,24 @@ class OC_App { } }); + $activeApp = OC::$server->getNavigationManager()->getActiveEntry(); + foreach ($list as $index => &$navEntry) { + if ($navEntry['id'] == $activeApp) { + $navEntry['active'] = true; + $activeAppIndex = $index; + } else { + $navEntry['active'] = false; + } + } + unset($navEntry); + + // Move active app to the first position + if($activeAppIndex > 2) { + $active = $list[$activeAppIndex]; + unset($list[$activeAppIndex]); + array_unshift($list, $active); + } + return $list; } -- cgit v1.2.3 From a630e4629f2489e9d7678fbe6833cf926e2b968e Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Wed, 1 Mar 2017 23:04:27 +0100 Subject: Generate seperate menu list for header bar Signed-off-by: Julius Haertl --- core/css/header.scss | 13 +++++++++++-- core/templates/layout.user.php | 36 ++++++++++++++++++---------------- lib/private/TemplateLayout.php | 2 ++ lib/private/legacy/app.php | 44 +++++++++++++++++++++++++++++++++++++++--- 4 files changed, 73 insertions(+), 22 deletions(-) (limited to 'lib/private/legacy') diff --git a/core/css/header.scss b/core/css/header.scss index c67df9ba17b..99329ccd631 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -349,6 +349,9 @@ #apps { max-height: calc(100vh - 100px); overflow: auto; + .in-header { + display: none; + } } /* USER MENU -----------------------------------------------------------------*/ @@ -553,9 +556,15 @@ position: absolute; pointer-events: none; border-bottom-color: white; - border-width: 8px; + border-width: 10px; transform: translateX(-50%); left: 50%; - top: 17px; + top: 14px; z-index: 100; + display: block; +} + +// do not show active indicator when hovering other icons +#appmenu:hover li:not(:hover) a:before { + display:none; } diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 84e3690c91e..fb7ceb408c5 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -61,8 +61,7 @@
    - - +
  • class="active"> @@ -74,7 +73,7 @@
  • - 3): ?> + 4): ?> - + - -