Merge pull request #267 from ahodesuka/master

Scroll back up to anchor -42px when unexpanding images.
This commit is contained in:
Mayhem 2012-02-21 09:46:29 -08:00
commit db2b24704c
3 changed files with 5 additions and 4 deletions

View File

@ -3485,8 +3485,8 @@
var rect, thumb; var rect, thumb;
thumb = a.firstChild; thumb = a.firstChild;
if (thumb.hidden) { if (thumb.hidden) {
rect = a.parentNode.getBoundingClientRect(); rect = a.getBoundingClientRect();
if (rect.top < 0) d.body.scrollTop += rect.top; if (rect.top < 0) d.body.scrollTop += rect.top - 42;
if (rect.left < 0) d.body.scrollLeft += rect.left; if (rect.left < 0) d.body.scrollLeft += rect.left;
return imgExpand.contract(thumb); return imgExpand.contract(thumb);
} else { } else {

View File

@ -1,6 +1,7 @@
master master
- ahodesuka - ahodesuka
Add Open Reply in New Tab option for replies made from the main board (not dumping). Add Open Reply in New Tab option for replies made from the main board (not dumping).
Scroll back up (top of anchor - 42px) when unexpanding images.
- Mayhem - Mayhem
The Filter now has per filter settings: The Filter now has per filter settings:
- Filter the OP only along its thread, replies only, or both. - Filter the OP only along its thread, replies only, or both.

View File

@ -2804,8 +2804,8 @@ imgExpand =
toggle: (a) -> toggle: (a) ->
thumb = a.firstChild thumb = a.firstChild
if thumb.hidden if thumb.hidden
rect = a.parentNode.getBoundingClientRect() rect = a.getBoundingClientRect()
d.body.scrollTop += rect.top if rect.top < 0 d.body.scrollTop += rect.top - 42 if rect.top < 0
d.body.scrollLeft += rect.left if rect.left < 0 d.body.scrollLeft += rect.left if rect.left < 0
imgExpand.contract thumb imgExpand.contract thumb
else else