diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2013-01-10 21:02:28 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-01-11 08:35:51 -0500 |
commit | e4a786e1a4fdd85b391711688bcb9790f38b5352 (patch) | |
tree | 16b6d3e4c4920bf92d67987312d5a8e74b5970d0 | |
parent | 83cbf979788f22ba3bd1668507623c0dd6b57041 (diff) | |
download | jquery-ui-e4a786e1a4fdd85b391711688bcb9790f38b5352.tar.gz jquery-ui-e4a786e1a4fdd85b391711688bcb9790f38b5352.zip |
Tooltip: Avoid errors on mouseover of tooltips with parents that have no title attribute. Fixes #8955 - Tooltip: error when parent element has no title attribute using jQuery <1.7
This corrects a failing test with core 1.6, so no new test is required.
-rw-r--r-- | ui/jquery.ui.tooltip.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index b911c9960..5df93a002 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -46,7 +46,9 @@ $.widget( "ui.tooltip", { version: "@VERSION", options: { content: function() { - var title = $( this ).attr( "title" ); + // support: IE<9, Opera in jQuery <1.7 + // .text() can't accept undefined, so coerce to a string + var title = $( this ).attr( "title" ) || ""; // Escape title, since we're going from an attribute to raw HTML return $( "<a>" ).text( title ).html(); }, |