Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse navigation items based on container size #7830

Merged
merged 1 commit into from Mar 23, 2020

Conversation

cado1982
Copy link
Contributor

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.

- Previously a maximum of 8 items were shown.
- This change calculates the width of each item and displays as many as possible in the container.
- Any overflowing items will be moved to the ... menu
@nul800sebastiaan nul800sebastiaan linked an issue Mar 23, 2020 that may be closed by this pull request
@nul800sebastiaan nul800sebastiaan merged commit 3edfc42 into umbraco:v8/contrib Mar 23, 2020
@nul800sebastiaan
Copy link
Member

Thank you very much @cado1982 - that is an excellent first contribution! ⭐

Code looks good and works as expected! 👍

Do you have a profile on Our Umbraco that you can link to please? I'd love to give you a contrib badge!

@stefankip
Copy link

Nice job! Thanks 🥇

@cado1982
Copy link
Contributor Author

Thanks @nul800sebastiaan. I just made a profile https://our.umbraco.com/members/cado1982/ 👍

@cado1982 cado1982 deleted the temp-7797 branch March 23, 2020 13:17
@nul800sebastiaan
Copy link
Member

Wonderful, badge added! 👍

@nul800sebastiaan nul800sebastiaan added release/8.7.0 release/no-notes This is too small to add to the release notes or fixed after a beta/RC labels Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/no-notes This is too small to add to the release notes or fixed after a beta/RC release/8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom section hidden behind 3 dots
3 participants