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 ($) {
1616 . classList . toggle ( "hidden-on-mobile" ) ;
1717 } ) ;
1818 document . body . addEventListener ( "click" , function ( ev ) {
19+ const thisIsExpanded = ev . target . matches ( ".nav-expanded > .dropdown-label" )
1920 if ( ! ev . target . matches ( ".nav-dropdown-container" ) ) {
2021 Array . prototype . forEach . call ( document . getElementsByClassName ( "dropdown-label" ) , function ( el ) {
21- el . parentElement . classList . remove ( "nav-expanded" )
22+ el . parentElement . classList . remove ( "nav-expanded" ) ;
2223 } ) ;
2324 }
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" ) ;
2627 }
2728 } )
2829 } ) ;
You can’t perform that action at this time.
0 commit comments