Skip to content

Commit

Permalink
Dialog: Modified the dialog._size() to use outerHeight in calculating…
Browse files Browse the repository at this point in the history
… the nonContentHeight. Fixed #7692 - dialog: dialog height bug is incorrect when .ui-dialog padding set.
  • Loading branch information
JamesKhoury authored and scottgonzalez committed Nov 28, 2011
1 parent 06f6fa8 commit ce0afde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions tests/unit/dialog/dialog_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
2 changes: 1 addition & 1 deletion ui/jquery.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) {
Expand Down

3 comments on commit ce0afde

@scottgonzalez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JamesKhoury Can you please sign our CLA?

@JamesKhoury
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@scottgonzalez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Please sign in to comment.