From a73fb8ba7c65355152434ca7f27d0d229305c5a9 Mon Sep 17 00:00:00 2001 From: Dominic Barnes Date: Fri, 4 Apr 2014 14:47:40 -0500 Subject: [PATCH] Unbinding window events when cancelling hide Currently, the window events can be bound multiple times in some cases. If the hide is cancelled, then show is called again (ie: mouseover/out fun times) the winEvents simply get bound again, causing the previous handler to be forever bound (since unbind only gets the last one in the stack apparently, probably needs to be addressed in component/events somehow) This could probably be addressed more completely by using mouseenter/leave instead of mouseover/out, but that is not addressed in this commit. --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index cb54b3a..9dc7562 100644 --- a/index.js +++ b/index.js @@ -363,6 +363,8 @@ Tip.prototype.offset = function(pos){ */ Tip.prototype.cancelHide = function(){ + this.winEvents.unbind('resize', 'reposition'); + this.winEvents.unbind('scroll', 'reposition'); clearTimeout(this._hide); };