Fix loading image expansion in clones.

This commit is contained in:
Nicolas Stepien 2013-04-09 13:45:16 +02:00
parent 50a13f306f
commit 354f566672

View File

@ -3224,8 +3224,15 @@ ImageExpand =
name: 'Image Expansion'
cb: @node
node: ->
return unless @file and @file.isImage
$.on @file.thumb.parentNode, 'click', ImageExpand.cb.toggle
return unless @file?.isImage
{thumb} = @file
$.on thumb.parentNode, 'click', ImageExpand.cb.toggle
if @isClone and $.hasClass thumb, 'expanding'
# If we clone a post where the image is still loading,
# make it loading in the clone too.
ImageExpand.contract @
ImageExpand.expand @
return
if ImageExpand.on and !@isHidden
ImageExpand.expand @
cb: