diff --git a/tests/dialog.js b/tests/dialog.js index 56be158b6..5cd1f1250 100644 --- a/tests/dialog.js +++ b/tests/dialog.js @@ -376,9 +376,9 @@ test("stack", function() { test("title", function() { expect(4); function titleText() { - return dlg().find(".ui-dialog-title").text(); + return dlg().find(".ui-dialog-title").html(); } - el = $('
').dialog(); equals(titleText(), "", "[default]"); el.remove(); + el = $('
').dialog(); equals(titleText(), " ", "[default]"); el.remove(); el = $('
').dialog(); equals(titleText(), "foo", "title in element attribute"); el.remove(); el = $('
').dialog({ title: 'foo' }); equals(titleText(), "foo", "title in init options"); el.remove(); el = $('
').dialog({ title: 'bar' }); equals(titleText(), "bar", "title in init options should override title in element attribute"); el.remove(); diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index 72091e89d..42a06daa5 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -184,7 +184,7 @@ $.widget("ui.dialog", { this.uiDialog.resizable(value ? 'enable' : 'disable'); break; case "title": - $(".ui-dialog-title", this.uiDialogTitlebar).text(value); + $(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' '); break; case "width": this.uiDialog.width(value);