Skip to content
Permalink
Browse files

Tooltip: When calling the content response method multiple times, onl…

…y update the content, don't do any other processing.
  • Loading branch information
scottgonzalez committed Jun 13, 2012
1 parent a47f5dc commit e8b623207abcae500ffb3860378543906cd4e2b2
Showing with 10 additions and 7 deletions.
  1. +10 −7 ui/jquery.ui.tooltip.js
@@ -149,6 +149,14 @@ $.widget( "ui.tooltip", {
return;
}

// Content can be updated multiple times. If the tooltip already
// exists, then just update the content and bail.
var tooltip = this._find( target );
if ( tooltip.length ) {
tooltip.find( ".ui-tooltip-content" ).html( content );
return;
}

// if we have a title, clear it to prevent the native tooltip
// we have to check first to avoid defining a title if none exists
// (we don't want to cause an element to start matching [title])
@@ -164,15 +172,10 @@ $.widget( "ui.tooltip", {
}
}

// ajaxy tooltip can update an existing one
var tooltip = this._find( target );
if ( !tooltip.length ) {
tooltip = this._tooltip( target );
addDescribedBy( target, tooltip.attr( "id" ) );
}
tooltip = this._tooltip( target );
addDescribedBy( target, tooltip.attr( "id" ) );
tooltip.find( ".ui-tooltip-content" ).html( content );
tooltip
.stop( true )
.position( $.extend({
of: target
}, this.options.position ) )

0 comments on commit e8b6232

Please sign in to comment.
You can’t perform that action at this time.