File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,7 @@ jQuery Tools is a collection of the most important user-interface components for
66##Contributing
77
88Please issue pull requests to the [ dev branch] ( https://github.com/jquerytools/jquerytools/tree/dev ) .
9- This is where active development takes place, we then merge changes into master for releases
9+
10+ This is where active development takes place, we then merge changes into master for releases. That will become v1.2.6.
11+ Most of the development goes to 2.0 which is currently a private repository.
12+
Original file line number Diff line number Diff line change 282282 currMonth = date . getMonth ( ) ;
283283 currDay = date . getDate ( ) ;
284284
285+ // focus the input after selection (doesn't work in IE)
286+ if ( e . type == "click" && ! $ . browser . msie ) {
287+ input . focus ( ) ;
288+ }
285289
286290 // beforeChange
287291 e = e || $ . Event ( "api" ) ;
317321 if ( e . ctrlKey ) { return true ; }
318322 var key = e . keyCode ;
319323
320- // backspace clears the value
321- if ( key == 8 ) {
324+ // backspace or delete clears the value
325+ if ( key == 8 || key == 46 ) {
322326 input . val ( "" ) ;
323327 return self . hide ( e ) ;
324328 }
325329
326- // esc or tab key
330+ // esc or tab key exits
327331 if ( key == 27 || key == 9 ) { return self . hide ( e ) ; }
328332
329333 if ( $ ( KEYS ) . index ( key ) >= 0 ) {
664668 e . type = "onHide" ;
665669 fire . trigger ( e ) ;
666670
667- $ ( document ) . unbind ( "click.d" ) . unbind ( "keydown.d" ) ;
668-
669671 // cancelled ?
670672 if ( e . isDefaultPrevented ( ) ) { return ; }
671673
674+ $ ( document ) . unbind ( "click.d" ) . unbind ( "keydown.d" ) ;
675+
672676 // do the hide
673677 root . hide ( ) ;
674678 opened = false ;
729733 if ( ! opened && $ ( KEYS ) . index ( key ) >= 0 ) {
730734 self . show ( e ) ;
731735 return e . preventDefault ( ) ;
736+
737+ // clear value on backspace or delete
738+ } else if ( key == 8 || key == 46 ) {
739+ input . val ( "" ) ;
732740 }
733741
734742 // allow tab
You can’t perform that action at this time.
0 commit comments