Skip to content
Permalink
Browse files

Dialog: Verify that we get a string back from .attr( "title" ) before…

… using the return value. Fixes #5742 - Form field with `name="title"` moved to title area.
  • Loading branch information...
scottgonzalez committed Jul 14, 2010
1 parent cdd6161 commit 2c7a9e9ff3540365254ee1b9b3113e6c2ad9f5f3
Showing with 5 additions and 0 deletions.
  1. +1 −0 tests/unit/dialog/dialog.html
  2. +4 −0 ui/jquery.ui.dialog.js
@@ -19,6 +19,7 @@
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
<script type="text/javascript" src="../../../external/qunit.js"></script>
<script type="text/javascript" src="../../jquery.simulate.js"></script>
<script type="text/javascript" src="../testsuite.js"></script>

<script type="text/javascript" src="dialog_core.js"></script>
<script type="text/javascript" src="dialog_defaults.js"></script>
@@ -49,6 +49,10 @@ $.widget("ui.dialog", {
},
_create: function() {
this.originalTitle = this.element.attr('title');
// #5742 - .attr() might return a DOMElement
if ( typeof this.originalTitle !== "string" ) {
this.originalTitle = "";
}

var self = this,
options = self.options,

0 comments on commit 2c7a9e9

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