mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04: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
This commit is contained in:
parent
899d90709a
commit
8cf98798a5
@ -428,7 +428,7 @@ $.widget( "ui.tooltip", {
|
||||
this._addClass( content, "ui-tooltip-content" );
|
||||
this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );
|
||||
|
||||
tooltip.appendTo( this.document[ 0 ].body );
|
||||
tooltip.appendTo( this._appendTo( element ) );
|
||||
|
||||
return this.tooltips[ id ] = {
|
||||
element: element,
|
||||
@ -446,6 +446,16 @@ $.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