I am using Ben Alman’s outside events plugin to close a modal window when the user clicks outside of it. This worked great until I had the need to use jQuery UI’s datepicker inside the modal. Since the elements comprising the widget are not placed inside the modal, the modal closes when selecting a date, which is the correct behavior. To attempt to solve the problem, I did the following:
$('#modal-window, #ui-datepicker-div').one('clickoutside', function(){
// close the modal window
});
That just causes the modal window to close when it is clicked.
From the page you link in your question:
I’d use
event.targetalong withclosestto find whether the link was in the datepicker.