Skip to content

Commit 6d9194a

Browse files
committed
Dialog: Properly handle empty title with jQuery git
jQuery now returns `null` for empty attributes instead of `undefined`. Ref gh-1516 (cherry picked from commit fdbb85b)
1 parent 1ca4617 commit 6d9194a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ui/dialog.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ return $.widget( "ui.dialog", {
107107
index: this.element.parent().children().index( this.element )
108108
};
109109
this.originalTitle = this.element.attr( "title" );
110-
this.options.title = this.options.title || this.originalTitle;
110+
if ( this.options.title == null && this.originalTitle != null ) {
111+
this.options.title = this.originalTitle;
112+
}
111113

112114
this._createWrapper();
113115

@@ -422,10 +424,11 @@ return $.widget( "ui.dialog", {
422424
},
423425

424426
_title: function( title ) {
425-
if ( !this.options.title ) {
427+
if ( this.options.title ) {
428+
title.text( this.options.title );
429+
} else {
426430
title.html( " " );
427431
}
428-
title.text( this.options.title );
429432
},
430433

431434
_createButtonPane: function() {

0 commit comments

Comments
 (0)