aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tooltip.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-02 15:20:37 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-02 15:20:37 +0200
commit1f0e0b2bb158f6f51b1b65066ba6608471aa6034 (patch)
treeddba28a1e773ec68e002e4b4e2b44f129364c2cd /ui/jquery.ui.tooltip.js
parentff72467038f35fd7d031b33cf61d37ee02535a52 (diff)
parent48e5c853f995a825dd9d14cd2d8f592037f8505c (diff)
downloadjquery-ui-1f0e0b2bb158f6f51b1b65066ba6608471aa6034.tar.gz
jquery-ui-1f0e0b2bb158f6f51b1b65066ba6608471aa6034.zip
Merge branch 'master' into grunt
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r--ui/jquery.ui.tooltip.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index eddd9a0c9..23b3a9b71 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -99,7 +99,7 @@ $.widget( "ui.tooltip", {
return;
}
- if ( !target.data( "ui-tooltip-title" ) ) {
+ if ( target.attr( "title" ) ) {
target.data( "ui-tooltip-title", target.attr( "title" ) );
}
@@ -173,6 +173,12 @@ $.widget( "ui.tooltip", {
target = $( event ? event.currentTarget : this.element ),
tooltip = this._find( target );
+ // disabling closes the tooltip, so we need to track when we're closing
+ // to avoid an infinite loop in case the tooltip becomes disabled on close
+ if ( this.closing ) {
+ return;
+ }
+
// don't close if the element has focus
// this prevents the tooltip from closing if you hover while focused
if ( !force && this.document[0].activeElement === target[0] ) {
@@ -195,7 +201,9 @@ $.widget( "ui.tooltip", {
target.removeData( "tooltip-open" );
target.unbind( "mouseleave.tooltip focusout.tooltip keyup.tooltip" );
+ this.closing = true;
this._trigger( "close", event, { tooltip: tooltip } );
+ this.closing = false;
},
_tooltip: function( element ) {