fix open/close on settings nav item hover

This commit is contained in:
John Mitchell
2018-10-08 12:24:19 -04:00
parent 4dc6452dea
commit 4b26ac06ba
2 changed files with 16 additions and 3 deletions

View File

@@ -5,11 +5,15 @@ function atSideNavItemLink (scope, element, attrs, ctrl) {
if (attrs.showSettingsSubMenu) {
element.hover(() => {
scope.navVm.onSettingsNavItem = true;
scope.navVm.showSettingsSubMenu = true;
}, () => {
// TODO: don't hide when mouse is hovering over the sub menu itself
// currently it closes as soon as you nav off of the settings side nav item
scope.navVm.showSettingsSubMenu = false;
setTimeout(() => {
scope.navVm.onSettingsNavItem = false;
if (!scope.navVm.onSettingsSubPane) {
scope.navVm.showSettingsSubMenu = false;
}
}, 100);
});
}
}

View File

@@ -10,6 +10,15 @@ function atSideNavLink (scope, element, attrs, ctrl) {
scope.$emit('clickOutsideSideNav');
}
});
element.find('.at-SettingsSubPane').hover(() => {
scope.vm.onSettingsSubPane = true;
}, () => {
if (!scope.vm.onSettingsNavItem) {
scope.vm.onSettingsSubPane = false;
scope.vm.showSettingsSubMenu = false;
}
});
}
function AtSideNavController ($scope, $window) {