From d549ba6d43072f65c56159a136ad4c077d859d36 Mon Sep 17 00:00:00 2001 From: Brant Burnett Date: Mon, 1 Feb 2010 20:59:24 +0000 Subject: [PATCH] Datepicker: No longer dependent on dialog in order to close datepicker when dialog is closed (Refixed #4453 UI Datepicker inside UI Dialog Issue) --- ui/jquery.ui.datepicker.js | 7 ------- ui/jquery.ui.dialog.js | 5 +---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 38de5bc9d..c0d8533b1 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -652,10 +652,6 @@ $.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); }); } }, @@ -780,9 +776,6 @@ $.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 7d4b3c8cd..752f3ac2f 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -114,9 +114,6 @@ $.widget("ui.dialog", { .blur(function() { uiDialogTitlebarClose.removeClass('ui-state-focus'); }) - .mousedown(function(ev) { - ev.stopPropagation(); - }) .click(function(event) { self.close(event); return false; @@ -327,7 +324,7 @@ $.widget("ui.dialog", { heightBeforeDrag; self.uiDialog.draggable({ - cancel: '.ui-dialog-content', + cancel: '.ui-dialog-content, .ui-dialog-titlebar-close', handle: '.ui-dialog-titlebar', containment: 'document', start: function(event) { -- 2.39.5