From 5b61537e6e759cacc4295887200db6ac07086f54 Mon Sep 17 00:00:00 2001 From: Brant Burnett Date: Mon, 1 Feb 2010 16:10:41 +0000 Subject: [PATCH] Datepicker: Fixed #4453 UI Datepicker inside UI Dialog Issue --- ui/jquery.ui.datepicker.js | 7 +++++++ ui/jquery.ui.dialog.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 789afe1f1..551b22551 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -651,6 +651,10 @@ $.extend(Datepicker.prototype, { 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); }); } }, @@ -775,6 +779,9 @@ $.extend(Datepicker.prototype, { } } this._inDialog = false; + + if (inst._dialog) + inst._dialog.unbind('dialogclose.datepicker'); } }, diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 7694810b1..7d4b3c8cd 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -601,7 +601,7 @@ $.extend($.ui.dialog.overlay, { 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); -- 2.39.5