Datepicker: Improve document click event

This commit is contained in:
Felix Nagel 2014-06-17 16:25:24 +02:00 committed by Scott González
parent 6dfcd937f9
commit 43025392c5

View File

@ -184,8 +184,12 @@ widget = $.widget( "ui.datepicker", {
},
_documentEvents: {
click: function( event ) {
if ( this.isOpen && !$( event.target ).closest( this.element.add( this.calendar ) ).length ) {
mousedown: function( event ) {
if ( !this.isOpen ) {
return;
}
if ( !$( event.target ).closest( this.element.add( this.calendar ) ).length ) {
this.close( event );
}
}