]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Fixed #3713: Set default height to auto and default minHeight to 150. Now...
authorScott González <scott.gonzalez@gmail.com>
Wed, 31 Dec 2008 01:12:43 +0000 (01:12 +0000)
committerScott González <scott.gonzalez@gmail.com>
Wed, 31 Dec 2008 01:12:43 +0000 (01:12 +0000)
tests/dialog.js
ui/ui.dialog.js

index aa91037c70bef55f12e90eae4c594fb6ab449b53..b7f248964c1f84bea41f867f5b7af0fe8df9808e 100644 (file)
@@ -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 = $('<div></div>').dialog();
-               equals(dlg().height(), defaults.height, "default height");
+               equals(dlg().height(), defaults.minHeight, "default height");
        el.remove();
 
        el = $('<div></div>').dialog({ height: 437 });
index 2cb4d4447411a3d99d217c70b1f3e20923d8d21b..824f8d29f863de61c7ec5cc11a56111baa901771 100644 (file)
@@ -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: {},