mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
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.
This commit is contained in:
parent
06f6fa8524
commit
ce0afde900
@ -177,19 +177,24 @@ test("draggable", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("height", function() {
|
test("height", function() {
|
||||||
expect(3);
|
expect(4);
|
||||||
|
|
||||||
el = $('<div></div>').dialog();
|
el = $('<div></div>').dialog();
|
||||||
equals(dlg().height(), 150, "default height");
|
equals(dlg().outerHeight(), 150, "default height");
|
||||||
el.remove();
|
el.remove();
|
||||||
|
|
||||||
el = $('<div></div>').dialog({ height: 237 });
|
el = $('<div></div>').dialog({ height: 237 });
|
||||||
equals(dlg().height(), 237, "explicit height");
|
equals(dlg().outerHeight(), 237, "explicit height");
|
||||||
el.remove();
|
el.remove();
|
||||||
|
|
||||||
el = $('<div></div>').dialog();
|
el = $('<div></div>').dialog();
|
||||||
el.dialog('option', 'height', 238);
|
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();
|
el.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
ui/jquery.ui.dialog.js
vendored
2
ui/jquery.ui.dialog.js
vendored
@ -625,7 +625,7 @@ $.widget("ui.dialog", {
|
|||||||
height: "auto",
|
height: "auto",
|
||||||
width: options.width
|
width: options.width
|
||||||
})
|
})
|
||||||
.height();
|
.outerHeight();
|
||||||
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
|
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
|
||||||
|
|
||||||
if ( options.height === "auto" ) {
|
if ( options.height === "auto" ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user