From 5e14a4265af27681680d0c28e7e51387db8cef33 Mon Sep 17 00:00:00 2001 From: Pieter Lambrecht Date: Mon, 23 Jan 2023 09:27:21 +0100 Subject: [PATCH] Use CSS for 200ms navbar transition-delay --- netbox/project-static/dist/netbox-dark.css | Bin 374883 -> 374904 bytes netbox/project-static/dist/netbox-light.css | Bin 232430 -> 232451 bytes netbox/project-static/dist/netbox-print.css | Bin 726343 -> 726364 bytes netbox/project-static/dist/netbox.js.map | Bin 353676 -> 353676 bytes netbox/project-static/src/sidenav.ts | 21 ++++++++++++++++++++ netbox/project-static/styles/sidenav.scss | 1 + 6 files changed, 22 insertions(+) diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index 8b6b37a4cc545892c5ab1d46c60ebe75f8bc5a40..952965ed1ebf548242c0156428923df57158744c 100644 GIT binary patch delta 37 vcmV+=0NVfK@D}*+7J!5SgaU*Ev;+*omnFyq7L$*kK$n2T1P8ZN!UPZYJcFEi62TCfBXx+^%(q#qS#cw5AL$ diff --git a/netbox/project-static/dist/netbox-light.css b/netbox/project-static/dist/netbox-light.css index 27e804c3084267eba5a70d9352ea5fb676a6d35f..984bb01cd2016e8882b7b6637d840b17ac827abd 100644 GIT binary patch delta 29 lcmaDiov(QYUqcJy7N+3G(F7M2#)7Pc1l7LF~Pe)`jutvQva+wb8LY|qu_+@7n?b?Yer DlD!aQ delta 57 zcmcb!O6T}0orV_17N!>F7M2#)7Pc1l7LF~Pe)`iLtT_3m?~mtHn9i)nnK0cdkyE6d N)qrz5s{vQ|Qvfq!5z7Do diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index d0563b9fc670f99db1fe7ed2c7fb22555367e360..c7f12860cb62113818e19683dd6236b6042b8bb6 100644 GIT binary patch delta 49 zcmeA1dtzA~83VWfi)CHT$ZQ#$F+H!FMQr=N Ic-C{Q0QL_OoB#j- diff --git a/netbox/project-static/src/sidenav.ts b/netbox/project-static/src/sidenav.ts index d8207c9f7..b97c24f03 100644 --- a/netbox/project-static/src/sidenav.ts +++ b/netbox/project-static/src/sidenav.ts @@ -27,6 +27,12 @@ class SideNav { */ private sections: Section[] = []; + /** + * Tracker if the mouse on the navbar or not + */ + // private mouseOver: boolean = false; + + constructor(base: HTMLDivElement) { this.base = base; this.state = new StateManager( @@ -247,6 +253,18 @@ class SideNav { * Show the sidenav and expand any active sections. */ 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')) { this.bodyRemove('hide', 'hidden'); this.bodyAdd('show'); @@ -254,12 +272,15 @@ class SideNav { this.activateLink(link, 'expand'); } } + + } /** * Hide the sidenav and collapse any active sections. */ private onLeave(): void { + // this.mouseOver = false; if (!this.bodyHas('pinned')) { this.bodyRemove('show'); this.bodyAdd('hide'); diff --git a/netbox/project-static/styles/sidenav.scss b/netbox/project-static/styles/sidenav.scss index 4261e5120..9a906bce8 100644 --- a/netbox/project-static/styles/sidenav.scss +++ b/netbox/project-static/styles/sidenav.scss @@ -78,6 +78,7 @@ background-color: var(--nbx-sidebar-bg); border-right: 1px solid $border-color; transition: $transition-100ms-ease-in-out; + transition-delay: 200ms; // Media fixes for mobile resolutions. @include media-breakpoint-down(lg) {