Collapse navigation items based on container size #7830
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! This is my first contribution.
Description
This change is as a result of #7797 in which it was observed that a maximum of 8 navigation items are shown at the top of the dashboard even if room is available for more.
I removed the limit and adjusted the existing code to calculate the remaining space and show as many as possible.
To test, navigate to the dashboard and resize the browser width. Any items too large to fit in the navigation container will be hidden behind the "..." menu.
You can add extra navigation items for testing by editing line 26 in src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js as so
scope.sections = [...result, {alias: 'test', name: 'Test', routepath: null}];
If the active page is hidden in the overflow menu, both the overflow menu and the link inside the dropdown should be styled to show it is selected.
I tested with current Chrome and Firefox.