aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-10-05 16:20:43 -0400
committerScott González <scott.gonzalez@gmail.com>2010-10-05 16:20:43 -0400
commit302728bd87dca0a887e25bac7a8a7059865a42af (patch)
tree0d81b5ab006587862915d5d0c478390c9df34657 /ui/jquery.ui.dialog.js
parenta5c119558b0b40633269c7565339e5b20754c3d8 (diff)
downloadjquery-ui-302728bd87dca0a887e25bac7a8a7059865a42af.tar.gz
jquery-ui-302728bd87dca0a887e25bac7a8a7059865a42af.zip
Dialog: Fixed logic for mimicking minHeight. Fixes #6150 - Dialog height:auto does not work in IE6.
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r--ui/jquery.ui.dialog.js35
1 files changed, 21 insertions, 14 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index b000bf5bd..3d38df4c0 100644
--- a/ui/jquery.ui.dialog.js
+++ b/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());