if (inst.input.is(':visible') && !inst.input.is(':disabled'))
inst.input[0].focus();
$.datepicker._curInst = inst;
+
+ // find the dialog wrapping the input, if any, and bind to close event
+ inst._dialog = $(input).closest('.ui-dialog-content')
+ .bind('dialogclose.datepicker', function() { $.datepicker._hideDatepicker(input); });
}
},
}
}
this._inDialog = false;
+
+ if (inst._dialog)
+ inst._dialog.unbind('dialogclose.datepicker');
}
},
if ($.ui.dialog.overlay.instances.length) {
$(document).bind($.ui.dialog.overlay.events, function(event) {
// stop events if the z-index of the target is <= the z-index of the overlay
- return ($(event.target).zIndex() > $.ui.dialog.overlay.maxZ);
+ return ($(event.target).zIndex() >= $.ui.dialog.overlay.maxZ);
});
}
}, 1);