Dialog: If options.title is empty on init, set it to the title attribute of the dialog element.

This commit is contained in:
Scott González 2008-07-12 00:16:43 +00:00
parent ac6189fd57
commit d1b099907d

View File

@ -29,6 +29,8 @@ var setDataSwitch = {
$.widget("ui.dialog", { $.widget("ui.dialog", {
init: function() { init: function() {
this.options.title = this.options.title || this.element.attr('title');
var self = this, var self = this,
options = this.options, options = this.options,
resizeHandles = typeof options.resizable == 'string' resizeHandles = typeof options.resizable == 'string'
@ -48,7 +50,7 @@ $.widget("ui.dialog", {
height: '100%' height: '100%'
}), }),
title = options.title || uiDialogContent.attr('title') || ' ', title = options.title || ' ',
uiDialogTitlebar = (this.uiDialogTitlebar = uiDialogTitlebar = (this.uiDialogTitlebar =
$('<div class="ui-dialog-titlebar"/>')) $('<div class="ui-dialog-titlebar"/>'))
.append('<span class="ui-dialog-title">' + title + '</span>') .append('<span class="ui-dialog-title">' + title + '</span>')