Skip to content

Commit

Permalink
Tooltip: Clear the tracking interval on close. Fixes #8920 -Tooltip p…
Browse files Browse the repository at this point in the history
…otential setinterval endless loop.
  • Loading branch information
scottgonzalez committed Dec 18, 2012
1 parent 9f841df commit 9cbd4b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/jquery.ui.tooltip.js
Expand Up @@ -270,7 +270,7 @@ $.widget( "ui.tooltip", {
// as the tooltip is visible, position the tooltip using the most recent
// event.
if ( this.options.show && this.options.show.delay ) {
delayedShow = setInterval(function() {
delayedShow = this.delayedShow = setInterval(function() {
if ( tooltip.is( ":visible" ) ) {
position( positionOption.of );
clearInterval( delayedShow );
Expand Down Expand Up @@ -312,6 +312,9 @@ $.widget( "ui.tooltip", {
return;
}

// Clear the interval for delayed tracking tooltips
clearInterval( this.delayedShow );

// only set title if we had one before (see comment in _open())
if ( target.data( "ui-tooltip-title" ) ) {
target.attr( "title", target.data( "ui-tooltip-title" ) );
Expand Down

0 comments on commit 9cbd4b4

Please sign in to comment.