aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tooltip.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-19 21:29:41 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-19 21:29:41 +0100
commitd32a9e81ecb8a201c1737c3226a99c33ced451af (patch)
tree1e3e7da271ca51484bf63c15f626338de4eff9f2 /ui/jquery.ui.tooltip.js
parentdaacbaf22180cc269fb730d8652d5ee72389a6d0 (diff)
downloadjquery-ui-d32a9e81ecb8a201c1737c3226a99c33ced451af.tar.gz
jquery-ui-d32a9e81ecb8a201c1737c3226a99c33ced451af.zip
Tooltip: Mark target to prevent async results showing a tooltip that was closed already
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r--ui/jquery.ui.tooltip.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index 924ce4121..cb23e9a4d 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -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 } );