diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-02-21 17:48:55 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-02-21 17:48:55 +0100 |
commit | 6528b48b4762b0ddf3697580444fdf9f34e7eca9 (patch) | |
tree | 46e0e17d0b8356d0e9d142e9a00bdf242d5bbf2c /ui/jquery.ui.tooltip.js | |
parent | 98d72c7f6d0f1c535774d4db85556626e016603c (diff) | |
parent | d32a9e81ecb8a201c1737c3226a99c33ced451af (diff) | |
download | jquery-ui-6528b48b4762b0ddf3697580444fdf9f34e7eca9.tar.gz jquery-ui-6528b48b4762b0ddf3697580444fdf9f34e7eca9.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r-- | ui/jquery.ui.tooltip.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index a006f3bf7..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() { @@ -123,7 +129,10 @@ $.widget( "ui.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 don't want to cause an element to start matching [title]) - // TODO: document why we don't use .removeAttr() + + // We don't use removeAttr as that causes the native tooltip to show + // up in IE (9 and below, didn't yet test 10). Happens only when removing + // inside the mouseover handler. if ( target.is( "[title]" ) ) { target.attr( "title", "" ); } @@ -183,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 } ); |