Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix nav style behavior around 'click' #2373

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/scripts/directives/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ angular.module('openshiftConsole')
var clearHover = function() {
_.each($scope.navItems, function(navItem) {
navItem.isHover = false;
navItem.fakeHover = false;
});
};

Expand Down Expand Up @@ -101,6 +102,8 @@ angular.module('openshiftConsole')
// activated using the keyboard.
clearHover();

primaryItem.fakeHover = true;

// Open the item regardless of whether the mouse is really over it
// for keyboard and screen reader accessibility.
primaryItem.isHover = true;
Expand Down Expand Up @@ -136,6 +139,7 @@ angular.module('openshiftConsole')
primaryItem.mouseEnterTimeout = null;
}

primaryItem.fakeHover = false;
primaryItem.mouseLeaveTimeout = $timeout(function() {
primaryItem.isHover = false;
primaryItem.mouseLeaveTimeout = null;
Expand Down
2 changes: 1 addition & 1 deletion app/styles/_vertical-nav.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
&.active > a,
&:focus > a,
&:hover > a,
> a:focus,
&.fake-hover > a,
> a:hover {
background-color: @nav-pf-vertical-active-bg-color;
color: @nav-pf-vertical-active-color;
Expand Down
1 change: 1 addition & 0 deletions app/views/_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ng-class="{
active: primaryItem === activePrimary,
'is-hover': primaryItem.isHover,
'fake-hover': primaryItem.fakeHover,
'secondary-nav-item-pf': primaryItem.secondaryNavSections.length
}"
ng-if="show(primaryItem)"
Expand Down