-
-
Save stalniy/129a8859bf98cfc5d33e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
After jquery ui datepicker selection, blur and change | |
events fire before focus is returned to the input field, | |
handling a quirk from IE browsers | |
*/ | |
$("input.dateInput").datepicker({ | |
changeMonth: true, | |
changeYear: true, | |
showAnim: "fadeIn", | |
yearRange: 'c-30:c+30', | |
showButtonPanel: true, | |
/* fix buggy IE focus functionality */ | |
fixFocusIE: false, | |
/* blur needed to correctly handle placeholder text */ | |
onSelect: function(dateText, inst) { | |
this.fixFocusIE = true; | |
$(this).blur().change().focus(); | |
}, | |
onClose: function(dateText, inst) { | |
this.fixFocusIE = true; | |
this.focus(); | |
}, | |
beforeShow: function(input, inst) { | |
var result = $.browser.msie ? !this.fixFocusIE : true; | |
this.fixFocusIE = false; | |
return result; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment