Fix image contraction not always moving us back to the post.
This commit is contained in:
parent
a1efe855e2
commit
455778f865
@ -57,7 +57,6 @@ ImageExpand =
|
|||||||
unless post.file.isExpanded or $.hasClass thumb, 'expanding'
|
unless post.file.isExpanded or $.hasClass thumb, 'expanding'
|
||||||
ImageExpand.expand post
|
ImageExpand.expand post
|
||||||
return
|
return
|
||||||
ImageExpand.contract post
|
|
||||||
|
|
||||||
# Scroll back to the thumbnail when contracting the image
|
# Scroll back to the thumbnail when contracting the image
|
||||||
# to avoid being left miles away from the relevant post.
|
# to avoid being left miles away from the relevant post.
|
||||||
@ -70,6 +69,7 @@ ImageExpand =
|
|||||||
if rect.left < 0
|
if rect.left < 0
|
||||||
x = -window.scrollX
|
x = -window.scrollX
|
||||||
window.scrollBy x, y if x or y
|
window.scrollBy x, y if x or y
|
||||||
|
ImageExpand.contract post
|
||||||
|
|
||||||
contract: (post) ->
|
contract: (post) ->
|
||||||
$.rmClass post.nodes.root, 'expanded-image'
|
$.rmClass post.nodes.root, 'expanded-image'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user