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
6
6
##Contributing
7
7
8
8
Please 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 282
282
currMonth = date . getMonth ( ) ;
283
283
currDay = date . getDate ( ) ;
284
284
285
+ // focus the input after selection (doesn't work in IE)
286
+ if ( e . type == "click" && ! $ . browser . msie ) {
287
+ input . focus ( ) ;
288
+ }
285
289
286
290
// beforeChange
287
291
e = e || $ . Event ( "api" ) ;
317
321
if ( e . ctrlKey ) { return true ; }
318
322
var key = e . keyCode ;
319
323
320
- // backspace clears the value
321
- if ( key == 8 ) {
324
+ // backspace or delete clears the value
325
+ if ( key == 8 || key == 46 ) {
322
326
input . val ( "" ) ;
323
327
return self . hide ( e ) ;
324
328
}
325
329
326
- // esc or tab key
330
+ // esc or tab key exits
327
331
if ( key == 27 || key == 9 ) { return self . hide ( e ) ; }
328
332
329
333
if ( $ ( KEYS ) . index ( key ) >= 0 ) {
664
668
e . type = "onHide" ;
665
669
fire . trigger ( e ) ;
666
670
667
- $ ( document ) . unbind ( "click.d" ) . unbind ( "keydown.d" ) ;
668
-
669
671
// cancelled ?
670
672
if ( e . isDefaultPrevented ( ) ) { return ; }
671
673
674
+ $ ( document ) . unbind ( "click.d" ) . unbind ( "keydown.d" ) ;
675
+
672
676
// do the hide
673
677
root . hide ( ) ;
674
678
opened = false ;
729
733
if ( ! opened && $ ( KEYS ) . index ( key ) >= 0 ) {
730
734
self . show ( e ) ;
731
735
return e . preventDefault ( ) ;
736
+
737
+ // clear value on backspace or delete
738
+ } else if ( key == 8 || key == 46 ) {
739
+ input . val ( "" ) ;
732
740
}
733
741
734
742
// allow tab
You can’t perform that action at this time.
0 commit comments