@@ -629,11 +629,11 @@ $.widget("ui.dialog", {
629
629
* divs will both have width and height set, so we need to reset them
630
630
*/
631
631
var options = this . options ,
632
- nonContentHeight ;
632
+ nonContentHeight ,
633
+ minContentHeight ;
633
634
634
635
// reset content sizing
635
- // hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350)
636
- this . element . css ( {
636
+ this . element . show ( ) . css ( {
637
637
width : 'auto' ,
638
638
minHeight : 0 ,
639
639
height : 0
@@ -650,17 +650,24 @@ $.widget("ui.dialog", {
650
650
width : options . width
651
651
} )
652
652
. height ( ) ;
653
-
654
- this . element
655
- . css ( options . height === 'auto' ? {
656
- minHeight : Math . max ( options . minHeight - nonContentHeight , 0 ) ,
657
- height : $ . support . minHeight ? 'auto' :
658
- Math . max ( options . minHeight - nonContentHeight , 0 )
659
- } : {
660
- minHeight : 0 ,
661
- height : Math . max ( options . height - nonContentHeight , 0 )
662
- } )
663
- . show ( ) ;
653
+ minContentHeight = Math . max ( 0 , options . minHeight - nonContentHeight ) ;
654
+
655
+ if ( options . height === "auto" ) {
656
+ // only needed for IE6 support
657
+ if ( $ . support . minHeight ) {
658
+ this . element . css ( {
659
+ minHeight : minContentHeight ,
660
+ height : "auto"
661
+ } ) ;
662
+ } else {
663
+ this . uiDialog . show ( ) ;
664
+ var autoHeight = this . element . css ( "height" , "auto" ) . height ( ) ;
665
+ this . uiDialog . hide ( ) ;
666
+ this . element . height ( Math . max ( autoHeight , minContentHeight ) ) ;
667
+ }
668
+ } else {
669
+ this . element . height ( Math . max ( options . height - nonContentHeight , 0 ) ) ;
670
+ }
664
671
665
672
if ( this . uiDialog . is ( ':data(resizable)' ) ) {
666
673
this . uiDialog . resizable ( 'option' , 'minHeight' , this . _minHeight ( ) ) ;
0 commit comments