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');
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user