Fixes #7495: Fix sidenav overlapping elements

This commit is contained in:
thatmattlove 2021-10-15 15:02:50 -07:00
parent e16942dea5
commit f1f0d9cd0d
8 changed files with 30 additions and 7 deletions

View File

@ -4,6 +4,7 @@
### Bug Fixes ### Bug Fixes
* [#7495](https://github.com/netbox-community/netbox/issues/7495) - Fix navigation UI issue that caused improper element overlap
* [#7529](https://github.com/netbox-community/netbox/issues/7529) - Restore horizontal scrolling for tables in narrow viewports * [#7529](https://github.com/netbox-community/netbox/issues/7529) - Restore horizontal scrolling for tables in narrow viewports
* [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession
* [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -266,10 +266,8 @@ class SideNav {
for (const link of this.getActiveLinks()) { for (const link of this.getActiveLinks()) {
this.activateLink(link, 'collapse'); this.activateLink(link, 'collapse');
} }
setTimeout(() => { this.bodyRemove('hide');
this.bodyRemove('hide'); this.bodyAdd('hidden');
this.bodyAdd('hidden');
}, 300);
} }
} }

View File

@ -105,6 +105,11 @@
// Navbar brand // Navbar brand
.sidenav-brand { .sidenav-brand {
margin-right: 0; margin-right: 0;
transition: opacity 0.1s ease-in-out;
}
.sidenav-brand-icon {
transition: opacity 0.1s ease-in-out;
} }
.sidenav-inner { .sidenav-inner {
@ -141,7 +146,17 @@
} }
.sidenav-toggle { .sidenav-toggle {
display: none; // The sidenav toggle's default state is "hidden". Because modifying the `display` property
// isn't ideal for smooth transitions, combine opacity 0 (transparent) and position absolute
// to yield a similar result.
position: absolute;
display: inline-block;
opacity: 0;
// The transition itself is largely irrelevant, but CSS needs *something* to transition in
// order to apply a delay.
transition: opacity 10ms ease-in-out;
// Offset the transition delay so the icon isn't visible during the logo transition.
transition-delay: 0.1s;
} }
.sidenav-collapse { .sidenav-collapse {
@ -350,13 +365,21 @@
.sidenav-brand { .sidenav-brand {
position: absolute; position: absolute;
opacity: 0; opacity: 0;
transform: translateX(-150%);
} }
.sidenav-brand-icon { .sidenav-brand-icon {
opacity: 1; opacity: 1;
} }
.sidenav-toggle {
// Immediately hide the toggle when the sidenav is closed, so it doesn't linger and overlap
// with the logo elements.
opacity: 0;
position: absolute;
transition: unset;
transition-delay: 0ms;
}
.navbar-nav > .nav-item { .navbar-nav > .nav-item {
> .nav-link { > .nav-link {
&:after { &:after {
@ -402,7 +425,8 @@
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {
.sidenav-toggle { .sidenav-toggle {
display: inline-block; position: relative;
opacity: 1;
} }
} }
} }