diff options
author | Daniel Owens <daniel@matchstickmixup.com> | 2013-05-08 12:15:44 -0500 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-01-12 18:37:57 +0100 |
commit | 42099e44610face58172ed0ed27115fb2b84ab50 (patch) | |
tree | e97d8b5f9603bf04be982295b35c1fb51d2a1702 /ui | |
parent | ae1d6d5f90236405023964bb3061eccd6c625e39 (diff) | |
download | jquery-ui-42099e44610face58172ed0ed27115fb2b84ab50.tar.gz jquery-ui-42099e44610face58172ed0ed27115fb2b84ab50.zip |
Tooltip: Accept HTMLElement and jQuery objects for the content option
Fixes #9278
Closes #983
Closes #1421
Diffstat (limited to 'ui')
-rw-r--r-- | ui/tooltip.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ui/tooltip.js b/ui/tooltip.js index 7ea1d13ee..85c64f2a0 100644 --- a/ui/tooltip.js +++ b/ui/tooltip.js @@ -208,7 +208,8 @@ return $.widget( "ui.tooltip", { that = this, eventType = event ? event.type : null; - if ( typeof contentOption === "string" ) { + if ( typeof contentOption === "string" || contentOption.nodeType || + contentOption.jquery ) { return this._open( event, target, contentOption ); } @@ -276,13 +277,9 @@ return $.widget( "ui.tooltip", { // JAWS announces deletions even when aria-relevant="additions" // Voiceover will sometimes re-read the entire log region's contents from the beginning this.liveRegion.children().hide(); - if ( content.clone ) { - a11yContent = content.clone(); - a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); - } else { - a11yContent = content; - } - $( "<div>" ).html( a11yContent ).appendTo( this.liveRegion ); + a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() ); + a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); + a11yContent.appendTo( this.liveRegion ); function position( event ) { positionOption.of = event; |