Fix bug where an expanded image would error and never contract or expand again.

This commit is contained in:
Nicolas Stepien 2013-03-24 22:31:39 +01:00
parent 90f5533650
commit 3cee0f5db2

View File

@ -3199,7 +3199,10 @@ ImageExpand =
post = Get.postFromNode @
$.rm @
delete post.file.fullImage
unless $.hasClass post.file.thumb, 'expanding'
# Images can error:
# - before the image started loading.
# - after the image started loading.
unless $.hasClass(post.file.thumb, 'expanding') or $.hasClass post.nodes.root, 'expanded-image'
# Don't try to re-expend if it was already contracted.
return
ImageExpand.contract post