From 125448c8fb0e8af73cfb07d883ac4ffe7a557f89 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 15 Jul 2019 22:16:19 -0700 Subject: [PATCH] Multifile support in Reveal Spoiler Thumbnails. #2171 --- src/Images/RevealSpoilers.coffee | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Images/RevealSpoilers.coffee b/src/Images/RevealSpoilers.coffee index 1dc0fa1a1..30aae4d6b 100644 --- a/src/Images/RevealSpoilers.coffee +++ b/src/Images/RevealSpoilers.coffee @@ -7,13 +7,15 @@ RevealSpoilers = cb: @node node: -> - return unless not @isClone and @file and @file.thumb and @file.isSpoiler - {thumb} = @file - # Remove old width and height. - thumb.removeAttribute 'style' - # Enforce thumbnail size if thumbnail is replaced. - thumb.style.maxHeight = thumb.style.maxWidth = if @isReply then '125px' else '250px' - if thumb.src - thumb.src = @file.thumbURL - else - thumb.dataset.src = @file.thumbURL + return if @isClone + for file in @files when file.thumb and file.isSpoiler + {thumb} = file + # Remove old width and height. + thumb.removeAttribute 'style' + # Enforce thumbnail size if thumbnail is replaced. + thumb.style.maxHeight = thumb.style.maxWidth = if @isReply then '125px' else '250px' + if thumb.src + thumb.src = file.thumbURL + else + thumb.dataset.src = file.thumbURL + return