Fix image contraction not always moving us back to the post.

This commit is contained in:
Mayhem 2013-08-28 20:32:58 +02:00
parent a1efe855e2
commit 455778f865

View File

@ -57,7 +57,6 @@ ImageExpand =
unless post.file.isExpanded or $.hasClass thumb, 'expanding'
ImageExpand.expand post
return
ImageExpand.contract post
# Scroll back to the thumbnail when contracting the image
# to avoid being left miles away from the relevant post.
@ -70,6 +69,7 @@ ImageExpand =
if rect.left < 0
x = -window.scrollX
window.scrollBy x, y if x or y
ImageExpand.contract post
contract: (post) ->
$.rmClass post.nodes.root, 'expanded-image'