File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 434434 var initiated = false ;
435435 var self = this ;
436436 var selfDom = $ ( self ) . get ( 0 ) ;
437+ var domChangeTimer ;
437438
438439 $ ( this ) . unbind ( '.datepicker' ) . bind ( 'click.datepicker' , function ( evt )
439440 {
440441 var isOpen = box . is ( ':visible' ) ;
441- $ ( document ) . trigger ( 'click.datepicker' ) ;
442442 evt . stopPropagation ( ) ;
443443 if ( ! isOpen ) open ( opt . duration ) ;
444444 } ) . bind ( 'change.datepicker' , function ( evt )
445445 {
446446 checkAndSetDefaultValue ( ) ;
447+ } ) . bind ( 'keyup.datepicker' , function ( )
448+ {
449+ try { clearTimeout ( domChangeTimer ) ; } catch ( e ) { }
450+ domChangeTimer = setTimeout ( function ( )
451+ {
452+ checkAndSetDefaultValue ( ) ;
453+ } , 2000 ) ;
447454 } ) ;
448455
449456 init_datepicker . call ( this ) ;
585592 evt . stopPropagation ( ) ;
586593 } ) ;
587594
588- $ ( document ) . bind ( 'click.datepicker' , function ( )
595+ //if user click other place of the webpage, close date range picker window
596+ $ ( document ) . bind ( 'click.datepicker' , function ( evt )
589597 {
590598 if ( box . is ( ':visible' ) ) closeDatePicker ( ) ;
591599 } ) ;
You can’t perform that action at this time.
0 commit comments