Skip to content
Permalink
Browse files

Dialog: Fixed logic for mimicking minHeight. Fixes #6150 - Dialog hei…

…ght:auto does not work in IE6.
  • Loading branch information...
scottgonzalez committed Oct 5, 2010
1 parent a5c1195 commit 302728bd87dca0a887e25bac7a8a7059865a42af
Showing with 21 additions and 14 deletions.
  1. +21 −14 ui/jquery.ui.dialog.js
@@ -629,11 +629,11 @@ $.widget("ui.dialog", {
* divs will both have width and height set, so we need to reset them
*/
var options = this.options,
nonContentHeight;
nonContentHeight,
minContentHeight;

// reset content sizing
// hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350)
this.element.css({
this.element.show().css({
width: 'auto',
minHeight: 0,
height: 0
@@ -650,17 +650,24 @@ $.widget("ui.dialog", {
width: options.width
})
.height();

this.element
.css(options.height === 'auto' ? {
minHeight: Math.max(options.minHeight - nonContentHeight, 0),
height: $.support.minHeight ? 'auto' :
Math.max(options.minHeight - nonContentHeight, 0)
} : {
minHeight: 0,
height: Math.max(options.height - nonContentHeight, 0)
})
.show();
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );

if ( options.height === "auto" ) {
// only needed for IE6 support
if ( $.support.minHeight ) {
this.element.css({
minHeight: minContentHeight,
height: "auto"
});
} else {
this.uiDialog.show();
var autoHeight = this.element.css( "height", "auto" ).height();
this.uiDialog.hide();
this.element.height( Math.max( autoHeight, minContentHeight ) );
}
} else {
this.element.height( Math.max( options.height - nonContentHeight, 0 ) );
}

if (this.uiDialog.is(':data(resizable)')) {
this.uiDialog.resizable('option', 'minHeight', this._minHeight());

0 comments on commit 302728b

Please sign in to comment.
You can’t perform that action at this time.