Skip to content
Permalink
Browse files

Dialog: Properly handle empty title with jQuery git

jQuery now returns `null` for empty attributes instead of `undefined`.

Ref gh-1516
  • Loading branch information
scottgonzalez committed Mar 23, 2015
1 parent e4363ab commit fdbb85be397b1d1e632ead53a53c57d30739e70c
Showing with 6 additions and 3 deletions.
  1. +6 −3 ui/dialog.js
@@ -118,7 +118,9 @@ $.widget( "ui.dialog", {
index: this.element.parent().children().index( this.element )
};
this.originalTitle = this.element.attr( "title" );
this.options.title = this.options.title || this.originalTitle;
if ( this.options.title == null && this.originalTitle != null ) {
this.options.title = this.originalTitle;
}

this._createWrapper();

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

_title: function( title ) {
if ( !this.options.title ) {
if ( this.options.title ) {
title.text( this.options.title );
} else {
title.html( " " );
}
title.text( this.options.title );
},

_createButtonPane: function() {

0 comments on commit fdbb85b

Please sign in to comment.
You can’t perform that action at this time.