Skip to content

Commit fdbb85b

Browse files
committed
Dialog: Properly handle empty title with jQuery git
jQuery now returns `null` for empty attributes instead of `undefined`. Ref gh-1516
1 parent e4363ab commit fdbb85b

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
@@ -118,7 +118,9 @@ $.widget( "ui.dialog", {
118118
index: this.element.parent().children().index( this.element )
119119
};
120120
this.originalTitle = this.element.attr( "title" );
121-
this.options.title = this.options.title || this.originalTitle;
121+
if ( this.options.title == null && this.originalTitle != null ) {
122+
this.options.title = this.originalTitle;
123+
}
122124

123125
this._createWrapper();
124126

@@ -433,10 +435,11 @@ $.widget( "ui.dialog", {
433435
},
434436

435437
_title: function( title ) {
436-
if ( !this.options.title ) {
438+
if ( this.options.title ) {
439+
title.text( this.options.title );
440+
} else {
437441
title.html( " " );
438442
}
439-
title.text( this.options.title );
440443
},
441444

442445
_createButtonPane: function() {

0 commit comments

Comments
 (0)