From f394af20d01d3359ee5d7ab45696edbb81a27880 Mon Sep 17 00:00:00 2001 From: Tim Payne Date: Sun, 14 Oct 2018 16:43:52 +0100 Subject: [PATCH] Update umbsections.directive.js Update the number of sections to the actual number of sections available at the present time, add a fix to the calculateWidth method so that if less items are allowed than available but there is technically enough room to show them the overflow tray still shows up. On prior version, try adding translation to your allowed user group sections and reload, you can't see the translation section in the top menu, but the overflow menu button won't show until you shrink the screen. --- .../components/application/umbsections.directive.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js index 7f906ddcc0..5006087ca5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js @@ -12,7 +12,7 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se var sectionItemsWidth = []; var evts = []; - var maxSections = 7; + var maxSections = 8; //setup scope vars scope.maxSections = maxSections; @@ -46,8 +46,8 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se var sectionsWidth = 0; scope.totalSections = scope.sections.length; scope.maxSections = maxSections; - scope.overflowingSections = 0; - scope.needTray = false; + scope.overflowingSections = scope.maxSections - scope.totalSections; + scope.needTray = scope.sections.length > scope.maxSections; // detect how many sections we can show on the screen for (var i = 0; i < sectionItemsWidth.length; i++) {