From 8cc25cd32ad3940dec8dfb69109b1024b6ccf0ca Mon Sep 17 00:00:00 2001 From: ahodesuka Date: Thu, 19 Jan 2012 21:20:41 -0600 Subject: [PATCH] Scroll to top of reply instead of anchor --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index cf7704076..f0619043f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2994,7 +2994,7 @@ var rect, thumb; thumb = a.firstChild; if (thumb.hidden) { - rect = a.getBoundingClientRect(); + rect = a.parentNode.getBoundingClientRect(); if (rect.top < 0) d.body.scrollTop += rect.top; if (rect.left < 0) d.body.scrollLeft += rect.left; return imgExpand.contract(thumb); diff --git a/script.coffee b/script.coffee index c5e22e0bf..813abb1ed 100644 --- a/script.coffee +++ b/script.coffee @@ -2316,7 +2316,7 @@ imgExpand = toggle: (a) -> thumb = a.firstChild if thumb.hidden - rect = a.getBoundingClientRect() + rect = a.parentNode.getBoundingClientRect() d.body.scrollTop += rect.top if rect.top < 0 d.body.scrollLeft += rect.left if rect.left < 0 imgExpand.contract thumb