mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tooltip: When calling the content response method multiple times, only update the content, don't do any other processing.
This commit is contained in:
parent
a47f5dc4f2
commit
e8b623207a
17
ui/jquery.ui.tooltip.js
vendored
17
ui/jquery.ui.tooltip.js
vendored
@ -149,6 +149,14 @@ $.widget( "ui.tooltip", {
|
|||||||
return;
|
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
|
// 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 have to check first to avoid defining a title if none exists
|
||||||
// (we don't want to cause an element to start matching [title])
|
// (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
|
tooltip = this._tooltip( target );
|
||||||
var tooltip = this._find( target );
|
addDescribedBy( target, tooltip.attr( "id" ) );
|
||||||
if ( !tooltip.length ) {
|
|
||||||
tooltip = this._tooltip( target );
|
|
||||||
addDescribedBy( target, tooltip.attr( "id" ) );
|
|
||||||
}
|
|
||||||
tooltip.find( ".ui-tooltip-content" ).html( content );
|
tooltip.find( ".ui-tooltip-content" ).html( content );
|
||||||
tooltip
|
tooltip
|
||||||
.stop( true )
|
|
||||||
.position( $.extend({
|
.position( $.extend({
|
||||||
of: target
|
of: target
|
||||||
}, this.options.position ) )
|
}, this.options.position ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user