diff options
-rw-r--r-- | ui/tooltip.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/tooltip.js b/ui/tooltip.js index 8408f6781..23446ae65 100644 --- a/ui/tooltip.js +++ b/ui/tooltip.js @@ -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; |