diff options
author | Scott González <scott.gonzalez@gmail.com> | 2014-08-05 14:19:06 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2014-08-06 15:01:58 -0400 |
commit | 32bef7ad4ea120fb32a79e1ea49bd9b846bcf835 (patch) | |
tree | bd012672cc38ac7f164d3221e8cb19391a57b580 /tests/unit/tooltip | |
parent | d157b669b7b5d3208a2369c4ed9d0b159bb63d74 (diff) | |
download | jquery-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 'tests/unit/tooltip')
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index 710444b44..760ffeed2 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -154,4 +154,24 @@ asyncTest( "programmatic focus with async content", function() { element.focus(); }); +asyncTest( "destroy during hide animation; only one close event", function() { + expect( 1 ); + + var element = $( "#tooltipped1" ).tooltip({ + show: false, + hide: true + }); + + element.bind( "tooltipclose", function() { + ok( true, "tooltip closed" ); + }); + + element.tooltip( "open" ); + element.tooltip( "close" ); + setTimeout(function() { + element.tooltip( "destroy" ); + start(); + }); +}); + }( jQuery ) ); |