This ensures that we don't trigger the close event twice if the tooltip is
destroyed during the hide animation.
Closes gh-1306
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 ) );
}, this.options.position ) );
}
+ this.hiding = false;
+ this.closing = false;
tooltip.hide();
this._show( tooltip, this.options.show );
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" );
this.closing = true;
this._trigger( "close", event, { tooltip: tooltip } );
- this.closing = false;
+ if ( !this.hiding ) {
+ this.closing = false;
+ }
},
_tooltip: function( element ) {