uiDialogTitle = $( "<span>" )
.uniqueId()
.addClass( "ui-dialog-title" )
- .html( this.options.title || " " )
.prependTo( this.uiDialogTitlebar );
+ this._title( uiDialogTitle );
this.uiDialog.attr({
"aria-labelledby": uiDialogTitle.attr( "id" )
});
},
+ _title: function( title ) {
+ if ( !this.options.title ) {
+ title.html( " " );
+ }
+ title.text( this.options.title );
+ },
+
_createButtonPane: function() {
var uiDialogButtonPane = ( this.uiDialogButtonPane = $( "<div>" ) )
.addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
}
if ( key === "title" ) {
- // convert whatever was passed in to a string, for html() to not throw up
- $( ".ui-dialog-title", this.uiDialogTitlebar )
- .html( "" + ( value || " " ) );
+ this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
}
},