mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Tooltip: Follow the standard appendTo logic
Even though there's no reason to ever configure the parent element via an
`appendTo` option, following the standard logic is useful for scrollable
elements and native dialogs.
Fixes #10739
Closes gh-1517
(cherry picked from commit 8cf98798a5
)
This commit is contained in:
parent
f6379dc655
commit
977b33625b
@ -424,7 +424,7 @@ return $.widget( "ui.tooltip", {
|
||||
.addClass( "ui-tooltip-content" )
|
||||
.appendTo( tooltip );
|
||||
|
||||
tooltip.appendTo( this.document[0].body );
|
||||
tooltip.appendTo( this._appendTo( element ) );
|
||||
|
||||
return this.tooltips[ id ] = {
|
||||
element: element,
|
||||
@ -442,6 +442,16 @@ return $.widget( "ui.tooltip", {
|
||||
delete this.tooltips[ tooltip.attr( "id" ) ];
|
||||
},
|
||||
|
||||
_appendTo: function( target ) {
|
||||
var element = target.closest( ".ui-front, dialog" );
|
||||
|
||||
if ( !element.length ) {
|
||||
element = this.document[ 0 ].body;
|
||||
}
|
||||
|
||||
return element;
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
var that = this;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user