aboutsummaryrefslogtreecommitdiffstats
path: root/ui/tooltip.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2014-08-05 14:19:06 -0400
committerScott González <scott.gonzalez@gmail.com>2014-08-06 15:01:58 -0400
commit32bef7ad4ea120fb32a79e1ea49bd9b846bcf835 (patch)
treebd012672cc38ac7f164d3221e8cb19391a57b580 /ui/tooltip.js
parentd157b669b7b5d3208a2369c4ed9d0b159bb63d74 (diff)
downloadjquery-ui-32bef7ad4ea120fb32a79e1ea49bd9b846bcf835.tar.gz
jquery-ui-32bef7ad4ea120fb32a79e1ea49bd9b846bcf835.zip
Tooltip: Treat the tooltip as closing until it's fully removed
This ensures that we don't trigger the close event twice if the tooltip is destroyed during the hide animation. Closes gh-1306
Diffstat (limited to 'ui/tooltip.js')
-rw-r--r--ui/tooltip.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/tooltip.js b/ui/tooltip.js
index 52be04dcb..048b6324a 100644
--- a/ui/tooltip.js
+++ b/ui/tooltip.js
@@ -296,6 +296,8 @@ return $.widget( "ui.tooltip", {
}, this.options.position ) );
}
+ this.hiding = false;
+ this.closing = false;
tooltip.hide();
this._show( tooltip, this.options.show );
@@ -362,9 +364,12 @@ return $.widget( "ui.tooltip", {
this._removeDescribedBy( target );
+ this.hiding = true;
tooltip.stop( true );
this._hide( tooltip, this.options.hide, function() {
that._removeTooltip( $( this ) );
+ this.hiding = false;
+ this.closing = false;
});
target.removeData( "ui-tooltip-open" );
@@ -385,7 +390,9 @@ return $.widget( "ui.tooltip", {
this.closing = true;
this._trigger( "close", event, { tooltip: tooltip } );
- this.closing = false;
+ if ( !this.hiding ) {
+ this.closing = false;
+ }
},
_tooltip: function( element ) {