From d0247840d13596f0e4250fe9457d3f5787a68953 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 7 Sep 2014 14:52:16 -0700 Subject: [PATCH] copy details at moment of replacement and from the correct thumb (in case of clones) --- src/Images/ImageLoader.coffee | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Images/ImageLoader.coffee b/src/Images/ImageLoader.coffee index 6be528bfb..810055780 100755 --- a/src/Images/ImageLoader.coffee +++ b/src/Images/ImageLoader.coffee @@ -43,15 +43,6 @@ ImageLoader = if @file.isSpoiler # Revealed spoilers do not have height/width set, this fixes the image's dimensions. style.maxHeight = style.maxWidth = if @isReply then '125px' else '250px' - if isVideo - el.textContent = thumb.alt - el.dataset.md5 = thumb.dataset.md5 - el.style.height = style.height - el.style.width = style.width - el.style.maxHeight = style.maxHeight - el.style.maxWidth = style.maxWidth - el.loop = true - el.className = thumb.className cb = => $.off el, 'load loadeddata', cb ImageLoader.replace @, el @@ -79,11 +70,20 @@ ImageLoader = replace: (post, el) -> {file} = post {isVideo, thumb} = file + {style} = thumb if !post.isClone # Replace the thumbnail in clones added before the file was loaded. for clone in post.clones ImageLoader.replace clone, el.cloneNode true if isVideo + el.textContent = thumb.alt + el.dataset.md5 = thumb.dataset.md5 + el.style.height = style.height + el.style.width = style.width + el.style.maxHeight = style.maxHeight + el.style.maxWidth = style.maxWidth + el.loop = true + el.className = thumb.className $.on el, 'mouseover', ImageHover.mouseover if Conf['Image Hover'] $.replace thumb, el file.videoThumb = true