From 354f566672b2dc8a556c33d6a24c0ec33ee995c8 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 9 Apr 2013 13:45:16 +0200 Subject: [PATCH] Fix loading image expansion in clones. --- src/features.coffee | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/features.coffee b/src/features.coffee index d0dbb2805..bbdb3e3b2 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -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: