Skip to content

Commit

Permalink
Merge pull request #74 from sth/master
Browse files Browse the repository at this point in the history
Fix race condition when `delay()` is called after a timeout
  • Loading branch information
usmonster authored Mar 2, 2019
2 parents 1e121b1 + f4f6321 commit d4de07b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jquery.hoverIntent.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@

// triggers given `out` function at configured `timeout` after a mouseleave and clears state
var delay = function(ev,$el,s,out) {
delete $el.data('hoverIntent')[s.id];
var data = $el.data('hoverIntent');
if (data) {
delete data[s.id];
}
return out.apply($el[0],[ev]);
};

Expand Down

0 comments on commit d4de07b

Please sign in to comment.