mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
Use CSS for 200ms navbar transition-delay
This commit is contained in:
parent
a4d8169df8
commit
5e14a4265a
BIN
netbox/project-static/dist/netbox-dark.css
vendored
BIN
netbox/project-static/dist/netbox-dark.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox-light.css
vendored
BIN
netbox/project-static/dist/netbox-light.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox-print.css
vendored
BIN
netbox/project-static/dist/netbox-print.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -27,6 +27,12 @@ class SideNav {
|
|||||||
*/
|
*/
|
||||||
private sections: Section[] = [];
|
private sections: Section[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tracker if the mouse on the navbar or not
|
||||||
|
*/
|
||||||
|
// private mouseOver: boolean = false;
|
||||||
|
|
||||||
|
|
||||||
constructor(base: HTMLDivElement) {
|
constructor(base: HTMLDivElement) {
|
||||||
this.base = base;
|
this.base = base;
|
||||||
this.state = new StateManager<NavState>(
|
this.state = new StateManager<NavState>(
|
||||||
@ -247,6 +253,18 @@ class SideNav {
|
|||||||
* Show the sidenav and expand any active sections.
|
* Show the sidenav and expand any active sections.
|
||||||
*/
|
*/
|
||||||
private onEnter(): void {
|
private onEnter(): void {
|
||||||
|
// this.mouseOver = true;
|
||||||
|
// if (!this.bodyHas('pinned')) {
|
||||||
|
// setTimeout(() => {
|
||||||
|
// if (this.mouseOver) {
|
||||||
|
// this.bodyRemove('hide', 'hidden');
|
||||||
|
// this.bodyAdd('show');
|
||||||
|
// for (const link of this.getActiveLinks()) {
|
||||||
|
// this.activateLink(link, 'expand');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }, 200); // add a 200ms delay before the sidenav opens
|
||||||
|
// }
|
||||||
if (!this.bodyHas('pinned')) {
|
if (!this.bodyHas('pinned')) {
|
||||||
this.bodyRemove('hide', 'hidden');
|
this.bodyRemove('hide', 'hidden');
|
||||||
this.bodyAdd('show');
|
this.bodyAdd('show');
|
||||||
@ -254,12 +272,15 @@ class SideNav {
|
|||||||
this.activateLink(link, 'expand');
|
this.activateLink(link, 'expand');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide the sidenav and collapse any active sections.
|
* Hide the sidenav and collapse any active sections.
|
||||||
*/
|
*/
|
||||||
private onLeave(): void {
|
private onLeave(): void {
|
||||||
|
// this.mouseOver = false;
|
||||||
if (!this.bodyHas('pinned')) {
|
if (!this.bodyHas('pinned')) {
|
||||||
this.bodyRemove('show');
|
this.bodyRemove('show');
|
||||||
this.bodyAdd('hide');
|
this.bodyAdd('hide');
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
background-color: var(--nbx-sidebar-bg);
|
background-color: var(--nbx-sidebar-bg);
|
||||||
border-right: 1px solid $border-color;
|
border-right: 1px solid $border-color;
|
||||||
transition: $transition-100ms-ease-in-out;
|
transition: $transition-100ms-ease-in-out;
|
||||||
|
transition-delay: 200ms;
|
||||||
|
|
||||||
// Media fixes for mobile resolutions.
|
// Media fixes for mobile resolutions.
|
||||||
@include media-breakpoint-down(lg) {
|
@include media-breakpoint-down(lg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user