From 433958e2e38f4d6935f695e482e80693dc0ffeb9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 26 Mar 2017 20:26:05 +0200 Subject: Move app management to the settings menu Signed-off-by: Joas Schilling --- settings/img/apps.svg | 5 ++++- settings/js/apps.js | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'settings') diff --git a/settings/img/apps.svg b/settings/img/apps.svg index d1509ea3a37..b6e545799a3 100644 --- a/settings/img/apps.svg +++ b/settings/img/apps.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/settings/js/apps.js b/settings/js/apps.js index d2f26578a7c..253cc7b1eaf 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -537,14 +537,10 @@ OC.Settings.Apps = OC.Settings.Apps || { } } - - - if (navEntries.length > 7) { + if (navEntries.length > 8) { $('#more-apps').show(); - $('.apps-management').hide(); } else { $('#more-apps').hide(); - $('.apps-management').show(); } } }); -- cgit v1.2.3 From 0229c16e5fe9a20bc150b2162d22df6fe236cb9e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 26 Mar 2017 21:23:18 +0200 Subject: Don't use the dropdown for one item only Signed-off-by: Joas Schilling --- lib/private/legacy/app.php | 14 ++++++++++++-- settings/js/apps.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'settings') diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index a68f8605258..68a8383afbf 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -459,7 +459,6 @@ class OC_App { // This is private as well. It simply works, so don't ask for more details private static function proceedNavigation($list) { - $headerIconCount = 8; usort($list, function($a, $b) { if (isset($a['order']) && isset($b['order'])) { return ($a['order'] < $b['order']) ? -1 : 1; @@ -482,6 +481,11 @@ class OC_App { } unset($navEntry); + if (count($list) <= 8) { + return $list; + } + + $headerIconCount = 7; if($activeAppIndex > ($headerIconCount-1)) { $active = $list[$activeAppIndex]; $lastInHeader = $list[$headerIconCount-1]; @@ -502,7 +506,6 @@ class OC_App { } public static function proceedAppNavigation($entries) { - $headerIconCount = 8; $activeAppIndex = -1; $list = self::proceedNavigation($entries); @@ -515,6 +518,13 @@ class OC_App { $navEntry['active'] = false; } } + + + if (count($list) <= 8) { + return $list; + } + + $headerIconCount = 7; // move active item to last position if($activeAppIndex > ($headerIconCount-1)) { $active = $list[$activeAppIndex]; diff --git a/settings/js/apps.js b/settings/js/apps.js index 253cc7b1eaf..215b3c2c92e 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -530,7 +530,7 @@ OC.Settings.Apps = OC.Settings.Apps || { } previousEntry = entry; // do not show apps from #appmenu in #navigation - if(i < 7) { + if(i <= 7) { $('#navigation li').eq(i).addClass('in-header'); } else { $('#navigation li').eq(i).removeClass('in-header'); -- cgit v1.2.3