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

Fix top navigation positioning when window is resized #13007

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

LianaHarris360
Copy link
Member

Summary

This pull request adjusts the positioning of the NavBar within AppBar.vue so that the tabs in the navigation move to the second line when the page shrinks and there isn't enough space. Only after that, on smaller screen sizes, is the overflow menu dropdown button displayed.

This issue is most apparent in the Coach plugin when the classroom title is very long, however this change does impact other Kolibri plugins.

To prevent the overflow menu dropdown button from appearing when the navigation is at the top position, the top NavBar is hidden and the bottom NavBar is displayed if the breakpointLimit is less than the windowBreakpoint during window resizing. Alternatively, if the breakpointLimit is greater than the windowBreakpoint, the top NavBar is shown and the bottom NavBar is hidden.

Based on the length of the title property, the breakpointLimit is either 4 or 3. For example, if the page title is longer than 20 characters, the top NavBar will be shown until the windowBreakpoint equals 4.

A window resize event listener has also been added to AppBarPage to update appBarHeight and improve page responsiveness when the screen size and NavBar position changes, replacing the use of windowBreakpoint within AppBarPage.

Before:

384394615-d324f647-e98b-4ed3-9397-85248fec9568.mp4

After:

WindowResizing.mov

References

Fixes #12813

Reviewer guidance

  1. Create a class with a long class name.
  2. Navigate to Coach > Class home and resize the page to see the responsive design behavior

…sition and implement a window resize event listener to update showTopNavBar based on the breakpoint
…improve responsiveness with screen size and NavBar position changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant