From 6d9194ac118509f2855f5e02dec1f95c0eb3ac1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 23 Mar 2015 18:37:47 -0400 Subject: [PATCH] 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 fdbb85be397b1d1e632ead53a53c57d30739e70c) --- ui/dialog.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/dialog.js b/ui/dialog.js index c48d76db3..fc9e3fcea 100644 --- a/ui/dialog.js +++ b/ui/dialog.js @@ -107,7 +107,9 @@ return $.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(); @@ -422,10 +424,11 @@ return $.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() { -- 2.39.5