mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(): sidemenu, fix to hide subnav menu when you click on hover subnav items
This commit is contained in:
@@ -38,7 +38,6 @@ export class SideMenuCtrl {
|
||||
openUserDropdown() {
|
||||
this.orgMenu = [
|
||||
{section: 'You', cssClass: 'dropdown-menu-title'},
|
||||
{text: 'Preferences', url: this.getUrl('/profile')},
|
||||
{text: 'Profile', url: this.getUrl('/profile')},
|
||||
];
|
||||
|
||||
@@ -100,6 +99,22 @@ export function sideMenuDirective() {
|
||||
bindToController: true,
|
||||
controllerAs: 'ctrl',
|
||||
scope: {},
|
||||
link: function(scope, elem) {
|
||||
// hack to hide dropdown menu
|
||||
elem.on('click.dropdown', '.dropdown-menu a', function(evt) {
|
||||
var menu = $(evt.target).parents('.dropdown-menu');
|
||||
var parent = menu.parent();
|
||||
menu.detach();
|
||||
|
||||
setTimeout(function() {
|
||||
parent.append(menu);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
scope.$on("$destory", function() {
|
||||
elem.off('click.dropdown');
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -73,7 +73,7 @@
|
||||
// again by the mouse getting outside the hover space
|
||||
left: $side-menu-width - 0.2rem;
|
||||
background-color: rgba($side-menu-bg,$side-menu-opacity);
|
||||
@include animation('dropdown-anim 100ms ease-in-out 100ms forwards');
|
||||
@include animation('dropdown-anim 150ms ease-in-out 100ms forwards');
|
||||
z-index: -9999;
|
||||
}
|
||||
}
|
||||
@@ -82,11 +82,6 @@
|
||||
|
||||
@include keyframes(dropdown-anim) {
|
||||
0% {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
}
|
||||
1% {
|
||||
display: block;
|
||||
opacity: 0;
|
||||
transform: translate3d(-5%,0,0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user