mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
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.
This commit is contained in:
parent
83cbf97978
commit
e4a786e1a4
4
ui/jquery.ui.tooltip.js
vendored
4
ui/jquery.ui.tooltip.js
vendored
@ -46,7 +46,9 @@ $.widget( "ui.tooltip", {
|
|||||||
version: "@VERSION",
|
version: "@VERSION",
|
||||||
options: {
|
options: {
|
||||||
content: function() {
|
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
|
// Escape title, since we're going from an attribute to raw HTML
|
||||||
return $( "<a>" ).text( title ).html();
|
return $( "<a>" ).text( title ).html();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user