aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Khoury <james@jameskhoury.com>2011-11-28 16:52:10 -0500
committerScott González <scott.gonzalez@gmail.com>2011-11-28 16:52:10 -0500
commitce0afde900fb2b55b5766a3e0e3029e24a094a75 (patch)
treec272d29be8149417c870e8a3c0196805e5f66df6
parent06f6fa8524a905ec8027b8ba756eb199f2591336 (diff)
downloadjquery-ui-ce0afde900fb2b55b5766a3e0e3029e24a094a75.tar.gz
jquery-ui-ce0afde900fb2b55b5766a3e0e3029e24a094a75.zip
Dialog: Modified the dialog._size() to use outerHeight in calculating the nonContentHeight. Fixed #7692 - dialog: dialog height bug is incorrect when .ui-dialog padding set.
-rw-r--r--tests/unit/dialog/dialog_options.js13
-rw-r--r--ui/jquery.ui.dialog.js2
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index eab577c69..264c2fb6e 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -177,19 +177,24 @@ test("draggable", function() {
});
test("height", function() {
- expect(3);
+ expect(4);
el = $('<div></div>').dialog();
- equals(dlg().height(), 150, "default height");
+ equals(dlg().outerHeight(), 150, "default height");
el.remove();
el = $('<div></div>').dialog({ height: 237 });
- equals(dlg().height(), 237, "explicit height");
+ equals(dlg().outerHeight(), 237, "explicit height");
el.remove();
el = $('<div></div>').dialog();
el.dialog('option', 'height', 238);
- equals(dlg().height(), 238, "explicit height set after init");
+ equals(dlg().outerHeight(), 238, "explicit height set after init");
+ el.remove();
+
+ el = $('<div></div>').css("padding", "20px")
+ .dialog({ height: 240 });
+ equals(dlg().outerHeight(), 240, "explicit height with padding");
el.remove();
});
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 49ef8f64b..3d7638667 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -625,7 +625,7 @@ $.widget("ui.dialog", {
height: "auto",
width: options.width
})
- .height();
+ .outerHeight();
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
if ( options.height === "auto" ) {