Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions themes/base/jquery.ui.dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; outline: 0; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-titlebar-icon { position: absolute; top: 50%; left: 0.3em; margin: -8px 0 0 0; }
.ui-dialog .ui-dialog-titlebar-icon-spacer { width: 16px; height: 16px; display: block; float: left; margin-left: -0.3em; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
Expand Down
27 changes: 27 additions & 0 deletions ui/jquery.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ $.widget("ui.dialog", {
.html( title )
.prependTo( uiDialogTitlebar );

if (options.icon) {
(this.uiDialogTitleIconSpacer = $( "<span>" ))
.addClass( "ui-dialog-titlebar-icon-spacer" )
.prependTo( uiDialogTitlebar );
(this.uiDialogTitleIcon = $( "<span>" ))
.addClass( "ui-dialog-titlebar-icon ui-icon")
.addClass( options.icon )
.prependTo( uiDialogTitlebar );
}

uiDialogButtonPane = ( this.uiDialogButtonPane = $( "<div>" ) )
.addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );

Expand Down Expand Up @@ -580,6 +590,23 @@ $.widget("ui.dialog", {
$( ".ui-dialog-title", this.uiDialogTitlebar )
.html( "" + ( value || "&#160;" ) );
break;
case "icon":
if (typeof value === "string")
{
if (!this.uiDialogTitleIcon)
{
(this.uiDialogTitleIconSpacer = $( "<span>" ))
.addClass( "ui-dialog-titlebar-icon-spacer" )
.prependTo( uiDialogTitlebar );
(this.uiDialogTitleIcon = $( "<span>" ))
.prependTo( uiDialogTitlebar );
}
this.uiDialogTitleIcon
.removeClass()
.addClass( "ui-dialog-titlebar-icon ui-icon")
.addClass( value )
}
break;
}

this._super( key, value );
Expand Down