@@ -48,8 +48,8 @@ $.widget("ui.dialog", {
48
48
draggable : true ,
49
49
hide : null ,
50
50
height : "auto" ,
51
- maxHeight : false ,
52
- maxWidth : false ,
51
+ maxHeight : null ,
52
+ maxWidth : null ,
53
53
minHeight : 150 ,
54
54
minWidth : 150 ,
55
55
modal : false ,
@@ -89,6 +89,7 @@ $.widget("ui.dialog", {
89
89
display : this . element [ 0 ] . style . display ,
90
90
width : this . element [ 0 ] . style . width ,
91
91
minHeight : this . element [ 0 ] . style . minHeight ,
92
+ maxHeight : this . element [ 0 ] . style . maxHeight ,
92
93
height : this . element [ 0 ] . style . height
93
94
} ;
94
95
this . originalTitle = this . element . attr ( "title" ) ;
@@ -632,16 +633,16 @@ $.widget("ui.dialog", {
632
633
} ,
633
634
634
635
_size : function ( ) {
635
-
636
636
// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
637
637
// divs will both have width and height set, so we need to reset them
638
- var nonContentHeight , minContentHeight ,
638
+ var nonContentHeight , minContentHeight , maxContentHeight ,
639
639
options = this . options ;
640
640
641
641
// reset content sizing
642
642
this . element . show ( ) . css ( {
643
643
width : "auto" ,
644
644
minHeight : 0 ,
645
+ maxHeight : "none" ,
645
646
height : 0
646
647
} ) ;
647
648
@@ -657,14 +658,18 @@ $.widget("ui.dialog", {
657
658
} )
658
659
. outerHeight ( ) ;
659
660
minContentHeight = Math . max ( 0 , options . minHeight - nonContentHeight ) ;
661
+ maxContentHeight = typeof options . maxHeight === "number" ?
662
+ Math . max ( 0 , options . maxHeight - nonContentHeight ) :
663
+ "none" ;
660
664
661
665
if ( options . height === "auto" ) {
662
666
this . element . css ( {
663
667
minHeight : minContentHeight ,
668
+ maxHeight : maxContentHeight ,
664
669
height : "auto"
665
670
} ) ;
666
671
} else {
667
- this . element . height ( Math . max ( options . height - nonContentHeight , 0 ) ) ;
672
+ this . element . height ( Math . max ( 0 , options . height - nonContentHeight ) ) ;
668
673
}
669
674
670
675
if ( this . uiDialog . is ( ":data(ui-resizable)" ) ) {
0 commit comments