I would like to close the query ui modalbox when the user clicks on the rest of the page that is in the background.
I added this snippet to do this but it isn't working:
$('.ui-widget-overlay').on("click", function() {
//Close the dialog
$(this).find(".dialog").dialog("close");
});