scroll so that full image/video is on screen after expansion
This commit is contained in:
parent
eee835fec7
commit
8e2f9167fb
@ -178,6 +178,12 @@ ImageExpand =
|
||||
# Scroll to keep our place in the thread when images are expanded above us.
|
||||
if oldBottom? and oldBottom <= 0
|
||||
window.scrollBy 0, post.nodes.root.getBoundingClientRect().bottom - oldBottom
|
||||
return
|
||||
|
||||
# Scroll to display full image.
|
||||
imageBottom = Header.getBottomOf file.fullImage
|
||||
if imageBottom < 0
|
||||
window.scrollBy 0, Math.min(-imageBottom, Header.getTopOf file.fullImage)
|
||||
|
||||
play: (post) ->
|
||||
if !d.hidden and Header.isNodeVisible post.file.fullImage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user