aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-03-23 18:37:47 -0400
committerScott González <scott.gonzalez@gmail.com>2015-03-25 15:55:16 -0400
commitfdbb85be397b1d1e632ead53a53c57d30739e70c (patch)
treeae53d8d4ee8943d760b261ef796d7520b153108a /ui
parente4363ab82d0997a00c96e0f4b3a504a94ddfe62e (diff)
downloadjquery-ui-fdbb85be397b1d1e632ead53a53c57d30739e70c.tar.gz
jquery-ui-fdbb85be397b1d1e632ead53a53c57d30739e70c.zip
Dialog: Properly handle empty title with jQuery git
jQuery now returns `null` for empty attributes instead of `undefined`. Ref gh-1516
Diffstat (limited to 'ui')
-rw-r--r--ui/dialog.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/dialog.js b/ui/dialog.js
index 2f322aa86..c7ffbd9ef 100644
--- a/ui/dialog.js
+++ b/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( "&#160;" );
}
- title.text( this.options.title );
},
_createButtonPane: function() {