File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,17 @@ window.addEventListener('DOMContentLoaded', function () {
3131 $ ( '#remote_address' ) . focus ( ) ;
3232 } ) ;
3333
34- } ) ;
3534
36- $ ( document ) . mouseup ( function ( e ) {
37- var toggle = $ ( '#body-public' ) . find ( '.header-right .menutoggle' ) ;
38- var container = toggle . next ( '.popovermenu' ) ;
35+ $ ( document ) . mouseup ( function ( e ) {
36+ var toggle = $ ( '#body-public' ) . find ( '.header-right .menutoggle' ) ;
37+ var container = toggle . next ( '.popovermenu' ) ;
38+
39+ // if the target of the click isn't the menu toggle, nor a descendant of the
40+ // menu toggle, nor the container nor a descendant of the container
41+ if ( ! toggle . is ( e . target ) && toggle . has ( e . target ) . length === 0 &&
42+ ! container . is ( e . target ) && container . has ( e . target ) . length === 0 ) {
43+ container . removeClass ( 'open' ) ;
44+ }
45+ } ) ;
3946
40- // if the target of the click isn't the menu toggle, nor a descendant of the
41- // menu toggle, nor the container nor a descendant of the container
42- if ( ! toggle . is ( e . target ) && toggle . has ( e . target ) . length === 0 &&
43- ! container . is ( e . target ) && container . has ( e . target ) . length === 0 ) {
44- container . removeClass ( 'open' ) ;
45- }
4647} ) ;
You can’t perform that action at this time.
0 commit comments