]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker: Fixed #4453 UI Datepicker inside UI Dialog Issue
authorBrant Burnett <btburnett3@gmail.com>
Mon, 1 Feb 2010 16:10:41 +0000 (16:10 +0000)
committerBrant Burnett <btburnett3@gmail.com>
Mon, 1 Feb 2010 16:10:41 +0000 (16:10 +0000)
ui/jquery.ui.datepicker.js
ui/jquery.ui.dialog.js

index 789afe1f18e44eab3ac3b26054d3c77dce18770e..551b2255173136e663f2bb9a93915da01406eb28 100644 (file)
@@ -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');
                }
        },
 
index 7694810b1241ec9ce88dbb221df1e8c93b0cf7ad..7d4b3c8cdfa6e961f3e10ac9a7ac98748371157e 100644 (file)
@@ -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);