From 2789fca8afb34dc770df8163fad7f6df15a77025 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 31 Dec 2008 01:12:43 +0000 Subject: [PATCH] Dialog: Fixed #3713: Set default height to auto and default minHeight to 150. Now applying minHeight to the content div instead of only using it for resizing. --- tests/dialog.js | 6 +++--- ui/ui.dialog.js | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/dialog.js b/tests/dialog.js index aa91037c7..b7f248964 100644 --- a/tests/dialog.js +++ b/tests/dialog.js @@ -14,10 +14,10 @@ var defaults = { disabled: false, dialogClass: undefined, draggable: true, - height: 200, + height: 'auto', maxHeight: undefined, maxWidth: undefined, - minHeight: 100, + minHeight: 150, minWidth: 150, modal: false, overlay: {}, @@ -365,7 +365,7 @@ test("height", function() { expect(3); el = $('
').dialog(); - equals(dlg().height(), defaults.height, "default height"); + equals(dlg().height(), defaults.minHeight, "default height"); el.remove(); el = $('
').dialog({ height: 437 }); diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index 2cb4d4447..824f8d29f 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -448,10 +448,13 @@ $.widget("ui.dialog", { }) .height(); - this.element.height( - options.height == 'auto' - ? 'auto' - : options.height - nonContentHeight); + this.element + .css({ + minHeight: options.minHeight - nonContentHeight, + height: options.height == 'auto' + ? 'auto' + : options.height - nonContentHeight + }); } }); @@ -464,8 +467,8 @@ $.extend($.ui.dialog, { closeOnEscape: true, closeText: 'close', draggable: true, - height: 200, - minHeight: 100, + height: 'auto', + minHeight: 150, minWidth: 150, modal: false, overlay: {}, -- 2.39.5