1- $ ( document ) . ready ( function ( ) {
2- // hack the "All States" check box
3- $ ( "#id_state" ) . addClass ( "list-inline" ) ;
1+ $ ( document )
2+ . ready ( function ( ) {
3+ // hack the "All States" check box
4+ $ ( "#id_state" )
5+ . addClass ( "list-inline" ) ;
46
5- $ ( "#id_state input[value!=all]" ) . change ( function ( e ) {
6- if ( this . checked ) {
7- $ ( "#id_state input[value=all]" ) . prop ( 'checked' , false ) ;
8- }
9- } ) ;
7+ $ ( "#id_state input[value!=all]" )
8+ . on ( "change" , function ( e ) {
9+ if ( this . checked ) {
10+ $ ( "#id_state input[value=all]" )
11+ . prop ( 'checked' , false ) ;
12+ }
13+ } ) ;
1014
11- $ ( "#id_state_0" ) . change ( function ( e ) {
12- if ( this . checked ) {
13- $ ( "#id_state input[value!=all]" ) . prop ( 'checked' , false ) ;
14- }
15- } ) ;
15+ $ ( "#id_state_0" )
16+ . on ( "change" , function ( e ) {
17+ if ( this . checked ) {
18+ $ ( "#id_state input[value!=all]" )
19+ . prop ( 'checked' , false ) ;
20+ }
21+ } ) ;
1622
17- // make enter presses submit through the nearby button
18- $ ( "form.ipr-search input,select" ) . keyup ( function ( e ) {
19- var submitButton = $ ( this ) . closest ( ".mb-3" ) . find ( 'button[type=submit]' ) ;
20- if ( e . which == 13 && submitButton . length > 0 ) {
21- submitButton . click ( ) ;
22- return false ;
23- } else {
24- return true ;
25- }
26- } ) ;
27- } ) ;
23+ // make enter presses submit through the nearby button
24+ // FIXME: this seems to be broken
25+ $ ( "form.ipr-search input,select" )
26+ . on ( "keyup" , function ( e ) {
27+ var submitButton = $ ( this )
28+ . closest ( ".mb-3" )
29+ . find ( 'button[type=submit]' ) ;
30+ if ( e . which == 13 && submitButton . length > 0 ) {
31+ submitButton . trigger ( "click" ) ;
32+ return false ;
33+ } else {
34+ return true ;
35+ }
36+ } ) ;
37+ } ) ;
0 commit comments