Using UI dialog. jquery 1.4.2
I have my code to close a dialog when clicked outside. This doesn't work for me. However, if I up the version on a local development, it works fine. The issue is, that I can't up the jquery version for this part of the site.
Thoughts on how to achieve clicking outside a non-modal dialog to close?
// Close Pop-in If the user clicks anywhere else on the page
jQuery('body')
.bind(
'click',
function(e){
if(
jQuery('.detailsPopup').dialog('isOpen')
&& !jQuery(e.target).is('.ui-dialog, a')
&& !jQuery(e.target).closest('.ui-dialog').length
){
jQuery('.detailsPopup').dialog('close');
}
}
);