Skip to content

Commit 2ce5129

Browse files
committed
Fix nav style behavior around 'click'
1 parent 2c032c4 commit 2ce5129

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Diff for: app/scripts/directives/nav.js

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ angular.module('openshiftConsole')
5959
var clearHover = function() {
6060
_.each($scope.navItems, function(navItem) {
6161
navItem.isHover = false;
62+
navItem.fakeHover = false;
6263
});
6364
};
6465

@@ -101,6 +102,8 @@ angular.module('openshiftConsole')
101102
// activated using the keyboard.
102103
clearHover();
103104

105+
primaryItem.fakeHover = true;
106+
104107
// Open the item regardless of whether the mouse is really over it
105108
// for keyboard and screen reader accessibility.
106109
primaryItem.isHover = true;
@@ -136,6 +139,7 @@ angular.module('openshiftConsole')
136139
primaryItem.mouseEnterTimeout = null;
137140
}
138141

142+
primaryItem.fakeHover = false;
139143
primaryItem.mouseLeaveTimeout = $timeout(function() {
140144
primaryItem.isHover = false;
141145
primaryItem.mouseLeaveTimeout = null;

Diff for: app/styles/_vertical-nav.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
&.active > a,
3333
&:focus > a,
3434
&:hover > a,
35-
> a:focus,
35+
&.fake-hover > a,
3636
> a:hover {
3737
background-color: @nav-pf-vertical-active-bg-color;
3838
color: @nav-pf-vertical-active-color;

Diff for: app/views/_sidebar.html

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
ng-class="{
1818
active: primaryItem === activePrimary,
1919
'is-hover': primaryItem.isHover,
20+
'fake-hover': primaryItem.fakeHover,
2021
'secondary-nav-item-pf': primaryItem.secondaryNavSections.length
2122
}"
2223
ng-if="show(primaryItem)"

0 commit comments

Comments
 (0)