ux(): sidemenu, fix to hide subnav menu when you click on hover subnav items

This commit is contained in:
Torkel Ödegaard
2016-02-26 10:22:06 +01:00
parent c521182ceb
commit b98e5690eb
2 changed files with 17 additions and 7 deletions

View File

@@ -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');
});
}
};
}

View File

@@ -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);
}