Multifile support in Reveal Spoiler Thumbnails. #2171
This commit is contained in:
parent
5ddee89c74
commit
125448c8fb
@ -7,13 +7,15 @@ RevealSpoilers =
|
|||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
return unless not @isClone and @file and @file.thumb and @file.isSpoiler
|
return if @isClone
|
||||||
{thumb} = @file
|
for file in @files when file.thumb and file.isSpoiler
|
||||||
# Remove old width and height.
|
{thumb} = file
|
||||||
thumb.removeAttribute 'style'
|
# Remove old width and height.
|
||||||
# Enforce thumbnail size if thumbnail is replaced.
|
thumb.removeAttribute 'style'
|
||||||
thumb.style.maxHeight = thumb.style.maxWidth = if @isReply then '125px' else '250px'
|
# Enforce thumbnail size if thumbnail is replaced.
|
||||||
if thumb.src
|
thumb.style.maxHeight = thumb.style.maxWidth = if @isReply then '125px' else '250px'
|
||||||
thumb.src = @file.thumbURL
|
if thumb.src
|
||||||
else
|
thumb.src = file.thumbURL
|
||||||
thumb.dataset.src = @file.thumbURL
|
else
|
||||||
|
thumb.dataset.src = file.thumbURL
|
||||||
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user