mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tooltip: Mark target to prevent async results showing a tooltip that was closed already
This commit is contained in:
parent
daacbaf221
commit
d32a9e81ec
7
ui/jquery.ui.tooltip.js
vendored
7
ui/jquery.ui.tooltip.js
vendored
@ -103,7 +103,13 @@ $.widget( "ui.tooltip", {
|
||||
target.data( "tooltip-title", target.attr( "title" ) );
|
||||
}
|
||||
|
||||
target.data( "tooltip-open", true );
|
||||
|
||||
content = this.options.content.call( target[0], function( response ) {
|
||||
// ignore async response if tooltip was closed already
|
||||
if ( !target.data( "tooltip-open" ) ) {
|
||||
return;
|
||||
}
|
||||
// IE may instantly serve a cached response for ajax requests
|
||||
// delay this call to _open so the other call to _open runs first
|
||||
setTimeout(function() {
|
||||
@ -186,6 +192,7 @@ $.widget( "ui.tooltip", {
|
||||
delete that.tooltips[ this.id ];
|
||||
});
|
||||
|
||||
target.removeData( "tooltip-open" );
|
||||
target.unbind( "mouseleave.tooltip blur.tooltip keyup.tooltip" );
|
||||
|
||||
this._trigger( "close", event, { tooltip: tooltip } );
|
||||
|
Loading…
Reference in New Issue
Block a user