@@ -4,6 +4,7 @@ import { computed } from '@ember/object';
4
4
import { equal } from '@ember/object/computed' ;
5
5
import { inject as service } from '@ember/service' ;
6
6
import { schedule , next } from '@ember/runloop' ;
7
+ import { action } from '@ember/object' ;
7
8
8
9
export default Component . extend ( {
9
10
layout,
@@ -47,26 +48,25 @@ export default Component.extend({
47
48
} ) ;
48
49
} ,
49
50
50
- actions : {
51
- toggleDropdown ( event ) {
52
- this . get ( 'navbar' ) . closePopupMenu ( this ) ;
53
- this . toggleProperty ( 'isDropdownOpen' ) ;
51
+ @ action
52
+ toggleDropdown ( event ) {
53
+ this . get ( 'navbar' ) . closePopupMenu ( this ) ;
54
+ this . toggleProperty ( 'isDropdownOpen' ) ;
54
55
55
- if ( this . isDropdownOpen ) {
56
- // if it's open, let's make sure it can do some things
57
- schedule ( 'afterRender' , this , function ( ) {
58
- this . setupLinkBlurs ( ) ;
56
+ if ( this . isDropdownOpen ) {
57
+ // if it's open, let's make sure it can do some things
58
+ schedule ( 'afterRender' , this , function ( ) {
59
+ this . setupLinkBlurs ( ) ;
59
60
60
- // move focus to the first item in the dropdown only when opened with keyboard
61
- // ref https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
62
- if ( event . detail === 0 ) {
63
- this . processFirstElementFocus ( ) ;
64
- }
61
+ // move focus to the first item in the dropdown only when opened with keyboard
62
+ // ref https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
63
+ if ( event . detail === 0 ) {
64
+ this . processFirstElementFocus ( ) ;
65
+ }
65
66
66
- this . processKeyPress ( ) ;
67
- } ) ;
68
- }
69
- } ,
67
+ this . processKeyPress ( ) ;
68
+ } ) ;
69
+ }
70
70
} ,
71
71
72
72
closeDropdown ( ) {
0 commit comments