Scroll to the same position on the thumbnail as was being viewed before contracting
This commit is contained in:
parent
9baddbc771
commit
3d1de50d15
@ -2316,8 +2316,9 @@ imgExpand =
|
|||||||
toggle: (a) ->
|
toggle: (a) ->
|
||||||
thumb = a.firstChild
|
thumb = a.firstChild
|
||||||
if thumb.hidden
|
if thumb.hidden
|
||||||
if thumb.nextSibling.offsetHeight > d.body.clientHeight and (top = a.getBoundingClientRect().top) < 0
|
rect = a.getBoundingClientRect()
|
||||||
window.scroll window.scrollX, window.scrollY + top
|
d.body.scrollTop += if rect.top < 0 then rect.top + thumb.height / (rect.height / rect.top * -1) else 0
|
||||||
|
d.body.scrollLeft += if rect.left < 0 then rect.left + thumb.width / (rect.width / rect.left * -1) else 0
|
||||||
imgExpand.contract thumb
|
imgExpand.contract thumb
|
||||||
else
|
else
|
||||||
imgExpand.expand thumb
|
imgExpand.expand thumb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user