Skip to content

Commit 0a036c4

Browse files
MelSumnermansona
authored andcommitted
added an active class for the toggle button currently in use
1 parent 9c6a753 commit 0a036c4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

addon/components/es-navbar/link/component.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export default Component.extend({
3131
// move focus to the first item in the dropdown
3232
this.processFirstElementFocus();
3333
this.processKeyPress();
34-
35-
3634
});
3735
}
3836
}
@@ -49,7 +47,7 @@ export default Component.extend({
4947
this.processFirstElementFocus();
5048
},
5149

52-
processBlur() { //TODO is this working?
50+
processBlur() {
5351
next(this, function() {
5452
let subItems = Array.from(this.element.querySelectorAll('.navbar-dropdown-list li'));
5553
let focused = subItems.find(item => document.activeElement === item.querySelector('a'));
@@ -62,7 +60,7 @@ export default Component.extend({
6260
},
6361

6462
processClick() {
65-
63+
// TODO handle mouseclick outside the current dropdown
6664
},
6765

6866
processFirstElementFocus() {
@@ -103,6 +101,6 @@ export default Component.extend({
103101

104102
willDestroyElement() {
105103
document.removeEventListener('keydown', this.triggerDropdown);
106-
document.removeEventListener('click', this.triggerDropdown);
104+
// document.removeEventListener('click', this.triggerDropdown);
107105
}
108106
});

addon/components/es-navbar/link/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{#if (eq link.type "dropdown")}}
1010
<button
1111
onclick={{action "toggleDropdown"}}
12-
class="navbar-list-item-dropdown-toggle"
12+
class="navbar-list-item-dropdown-toggle {{if isDropdownOpen "active"}}"
1313
aria-expanded={{isExpanded}}
1414
>
1515
{{link.name}}

0 commit comments

Comments
 (0)