File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,14 @@ require(["jquery"], function ($) {
16
16
. classList . toggle ( "hidden-on-mobile" ) ;
17
17
} ) ;
18
18
document . body . addEventListener ( "click" , function ( ev ) {
19
+ const thisIsExpanded = ev . target . matches ( ".nav-expanded > .dropdown-label" )
19
20
if ( ! ev . target . matches ( ".nav-dropdown-container" ) ) {
20
21
Array . prototype . forEach . call ( document . getElementsByClassName ( "dropdown-label" ) , function ( el ) {
21
- el . parentElement . classList . remove ( "nav-expanded" )
22
+ el . parentElement . classList . remove ( "nav-expanded" ) ;
22
23
} ) ;
23
24
}
24
- if ( ev . target . matches ( ".dropdown-label" ) ) {
25
- ev . target . parentElement . classList . add ( "nav-expanded" )
25
+ if ( ! thisIsExpanded && ev . target . matches ( ".dropdown-label" ) ) {
26
+ ev . target . parentElement . classList . add ( "nav-expanded" ) ;
26
27
}
27
28
} )
28
29
} ) ;
You can’t perform that action at this time.
0 commit comments