@@ -61,6 +61,7 @@ $.widget( "ui.dialog", {
6161 minimizeText : "Minimize" ,
6262 restoreText : "Restore" ,
6363 draggable : true ,
64+ minimizable : false ,
6465 hide : null ,
6566 height : "auto" ,
6667 maxHeight : null ,
@@ -448,53 +449,55 @@ $.widget( "ui.dialog", {
448449 }
449450 } ) ;
450451
451- this . uiDialogTitlebarMinimize = $ ( "<button type='button'></button>" )
452- . button ( {
453- label : $ ( "<a>" ) . text ( this . options . minimizeText ) . html ( ) ,
454- icon : "ui-icon ui-icon-minimize" ,
455- showLabel : false
456- } )
457- . appendTo ( this . uiDialogTitlebar ) ;
458- this . _addClass ( this . uiDialogTitlebarMinimize , "ui-dialog-titlebar-minimize" ) ;
459- this . _on ( this . uiDialogTitlebarMinimize , {
460- click : function ( event ) {
461- event . preventDefault ( ) ;
462- this . options . restoreWidth = this . options . width ;
463- this . options . restoreHeight = this . options . height ;
464- this . uiDialog . width ( this . uiDialogTitlebar . outerWidth ( ) > 300 ? 300 : this . uiDialogTitlebar . outerWidth ( ) ) ;
465- this . uiDialog . height ( this . uiDialogTitlebar . outerHeight ( ) ) ;
466- this . element . hide ( ) ;
467- this . uiDialogButtonPane . hide ( ) ;
468- this . uiDialogTitlebarRestore . button ( "enable" ) ;
469- this . uiDialogTitlebarMinimize . button ( "disable" ) ;
470- }
471- } ) ;
472- this . uiDialogTitlebarRestore = $ ( "<button type='button'></button>" )
473- . button ( {
474- label : $ ( "<a>" ) . text ( this . options . restoreText ) . html ( ) ,
475- icon : "ui-icon ui-icon-restore" ,
476- showLabel : false
477- } )
478- . appendTo ( this . uiDialogTitlebar ) ;
479- this . _addClass ( this . uiDialogTitlebarRestore , "ui-dialog-titlebar-restore" ) ;
480- this . _on ( this . uiDialogTitlebarRestore , {
481- click : function ( event ) {
482- event . preventDefault ( ) ;
483- if ( this . options . restoreWidth !== undefined &&
484- this . options . restoreWidth !== null && this . options . restoreWidth !== "" ) {
485- this . uiDialog . width ( this . options . restoreWidth ) ;
452+ if ( this . options . minimizable ) {
453+ this . uiDialogTitlebarMinimize = $ ( "<button type='button'></button>" )
454+ . button ( {
455+ label : $ ( "<a>" ) . text ( this . options . minimizeText ) . html ( ) ,
456+ icon : "ui-icon ui-icon-minimize" ,
457+ showLabel : false
458+ } )
459+ . appendTo ( this . uiDialogTitlebar ) ;
460+ this . _addClass ( this . uiDialogTitlebarMinimize , "ui-dialog-titlebar-minimize" ) ;
461+ this . _on ( this . uiDialogTitlebarMinimize , {
462+ click : function ( event ) {
463+ event . preventDefault ( ) ;
464+ this . options . restoreWidth = this . options . width ;
465+ this . options . restoreHeight = this . options . height ;
466+ this . uiDialog . width ( this . uiDialogTitlebar . outerWidth ( ) > 300 ? 300 : this . uiDialogTitlebar . outerWidth ( ) ) ;
467+ this . uiDialog . height ( this . uiDialogTitlebar . outerHeight ( ) ) ;
468+ this . element . hide ( ) ;
469+ this . uiDialogButtonPane . hide ( ) ;
470+ this . uiDialogTitlebarRestore . button ( "enable" ) ;
471+ this . uiDialogTitlebarMinimize . button ( "disable" ) ;
486472 }
487- if ( this . options . restoreHeight !== undefined &&
488- this . options . restoreHeight !== null && this . options . restoreHeight !== "" ) {
489- this . uiDialog . height ( this . options . restoreHeight ) ;
473+ } ) ;
474+ this . uiDialogTitlebarRestore = $ ( "<button type='button'></button>" )
475+ . button ( {
476+ label : $ ( "<a>" ) . text ( this . options . restoreText ) . html ( ) ,
477+ icon : "ui-icon ui-icon-restore" ,
478+ showLabel : false
479+ } )
480+ . appendTo ( this . uiDialogTitlebar ) ;
481+ this . _addClass ( this . uiDialogTitlebarRestore , "ui-dialog-titlebar-restore" ) ;
482+ this . _on ( this . uiDialogTitlebarRestore , {
483+ click : function ( event ) {
484+ event . preventDefault ( ) ;
485+ if ( this . options . restoreWidth !== undefined &&
486+ this . options . restoreWidth !== null && this . options . restoreWidth !== "" ) {
487+ this . uiDialog . width ( this . options . restoreWidth ) ;
488+ }
489+ if ( this . options . restoreHeight !== undefined &&
490+ this . options . restoreHeight !== null && this . options . restoreHeight !== "" ) {
491+ this . uiDialog . height ( this . options . restoreHeight ) ;
492+ }
493+ this . element . show ( ) ;
494+ this . uiDialogButtonPane . show ( ) ;
495+ this . uiDialogTitlebarMinimize . button ( "enable" ) ;
496+ this . uiDialogTitlebarRestore . button ( "disable" ) ;
490497 }
491- this . element . show ( ) ;
492- this . uiDialogButtonPane . show ( ) ;
493- this . uiDialogTitlebarMinimize . button ( "enable" ) ;
494- this . uiDialogTitlebarRestore . button ( "disable" ) ;
495- }
496- } ) ;
497- this . uiDialogTitlebarRestore . button ( "disable" ) ;
498+ } ) ;
499+ this . uiDialogTitlebarRestore . button ( "disable" ) ;
500+ }
498501
499502 uiDialogTitle = $ ( "<span>" ) . uniqueId ( ) . prependTo ( this . uiDialogTitlebar ) ;
500503 this . _addClass ( uiDialogTitle , "ui-dialog-title" ) ;
0 commit comments