From 791c3fcd789b7cee1338abe18797efa42d989967 Mon Sep 17 00:00:00 2001 From: ahodesuka Date: Wed, 18 Jan 2012 21:01:44 -0600 Subject: [PATCH] Build --- 4chan_x.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index e49f56285..053ea029c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2991,12 +2991,12 @@ } }, toggle: function(a) { - var thumb, top; + var rect, thumb; thumb = a.firstChild; if (thumb.hidden) { - if (thumb.nextSibling.offsetHeight > d.body.clientHeight && (top = a.getBoundingClientRect().top) < 0) { - window.scroll(window.scrollX, window.scrollY + top); - } + rect = a.getBoundingClientRect(); + d.body.scrollTop += rect.top < 0 ? rect.top + thumb.height / (rect.height / rect.top * -1) : 0; + d.body.scrollLeft += rect.left < 0 ? rect.left + thumb.width / (rect.width / rect.left * -1) : 0; return imgExpand.contract(thumb); } else { return imgExpand.expand(thumb);