From e4a786e1a4fdd85b391711688bcb9790f38b5352 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Thu, 10 Jan 2013 21:02:28 -0500 Subject: 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. --- ui/jquery.ui.tooltip.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 $( "" ).text( title ).html(); }, -- cgit v1.2.3