From 07f6a586a501a8da3c0f8fac4650ff180e8d3f20 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 19 Feb 2012 21:54:25 +0100 Subject: [PATCH] Don't error if the image has loaded when it's not hovering anymore. --- 4chan_x.user.js | 1 + script.coffee | 1 + 2 files changed, 2 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index 349a12726..11eb2905d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3313,6 +3313,7 @@ }, load: function() { var style; + if (this !== ui.el) return; style = this.style; return ui.hover({ clientX: -45 + parseInt(style.left), diff --git a/script.coffee b/script.coffee index fb00a8b0d..407917995 100644 --- a/script.coffee +++ b/script.coffee @@ -2608,6 +2608,7 @@ imgHover = $.on @, 'mousemove', ui.hover $.on @, 'mouseout', imgHover.mouseout load: -> + return if @ isnt ui.el # 'Fake' mousemove event by giving required values. {style} = @ ui.hover