diff --git a/public/app/core/components/grafana_app.ts b/public/app/core/components/grafana_app.ts index 77089b14ddc..39601f903ec 100644 --- a/public/app/core/components/grafana_app.ts +++ b/public/app/core/components/grafana_app.ts @@ -79,21 +79,16 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop sidemenuOpen = scope.contextSrv.sidemenu; body.toggleClass('sidemenu-open', sidemenuOpen); - scope.$watch('contextSrv.sidemenu', newVal => { - if (sidemenuOpen !== scope.contextSrv.sidemenu) { - sidemenuOpen = scope.contextSrv.sidemenu; - body.toggleClass('sidemenu-open', scope.contextSrv.sidemenu); - } + appEvents.on('toggle-sidemenu', () => { + body.toggleClass('sidemenu-open'); }); - let sidemenuOpenSmallBreakpoint = scope.contextSrv.sidemenuSmallBreakpoint; - body.toggleClass('sidemenu-open--xs', sidemenuOpenSmallBreakpoint); + appEvents.on('toggle-sidemenu-mobile', () => { + body.toggleClass('sidemenu-open--xs'); + }); - scope.$watch('contextSrv.sidemenuSmallBreakpoint', newVal => { - if (sidemenuOpenSmallBreakpoint !== scope.contextSrv.sidemenuSmallBreakpoint) { - sidemenuOpenSmallBreakpoint = scope.contextSrv.sidemenuSmallBreakpoint; - body.toggleClass('sidemenu-open--xs', scope.contextSrv.sidemenuSmallBreakpoint); - } + appEvents.on('toggle-sidemenu-hidden', () => { + body.toggleClass('sidemenu-hidden'); }); // tooltip removal fix @@ -111,6 +106,9 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop } } + // clear body class sidemenu states + body.removeClass('sidemenu-open--xs'); + $("#tooltip, .tooltip").remove(); // check for kiosk url param diff --git a/public/app/core/components/sidemenu/sidemenu.html b/public/app/core/components/sidemenu/sidemenu.html index b47b7fc8265..7ed2ab1f2c7 100644 --- a/public/app/core/components/sidemenu/sidemenu.html +++ b/public/app/core/components/sidemenu/sidemenu.html @@ -3,11 +3,10 @@ - -

 Close

+ +  Close
-
diff --git a/public/sass/components/_sidemenu.scss b/public/sass/components/_sidemenu.scss index 605b15dd5bc..05882d75fc9 100644 --- a/public/sass/components/_sidemenu.scss +++ b/public/sass/components/_sidemenu.scss @@ -16,6 +16,14 @@ .sidemenu__close { display: none; } + +} + +// body class that hides sidemenu +.sidemenu-hidden { + .sidemenu { + display: none; + } } @include media-breakpoint-up(sm) { @@ -164,7 +172,7 @@ li.sidemenu-org-switcher { } } -.sidemenu__logo, .sidemenu__logo_small_breakpoint { +.sidemenu__logo { display: block; padding: 0.4rem 1.0rem 0.4rem 0.65rem; min-height: $navbarHeight; @@ -203,6 +211,8 @@ li.sidemenu-org-switcher { .sidemenu__close { display: block; font-size: $font-size-md; + position: relative; + top: -3px; } .sidemenu__top, @@ -215,14 +225,16 @@ li.sidemenu-org-switcher { .sidemenu__logo { display: none; } + .sidemenu__logo_small_breakpoint { + padding: 12px 10px 26px; display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; - &:hover { - background: transparent; + .fa-bars { + font-size: 25px; } } diff --git a/public/sass/pages/_login.scss b/public/sass/pages/_login.scss index 3c54224c4cc..2b3426b45b5 100644 --- a/public/sass/pages/_login.scss +++ b/public/sass/pages/_login.scss @@ -8,12 +8,6 @@ padding-top: $spacer * 5; /* BAD HACK - experiement to see how it looks */ } -.page-login { - .sidemenu { - display: none; - } -} - .login-form { display: inline-block; max-width: 24rem;