don't need to save the old thumb anymore

This commit is contained in:
ccd0 2014-09-06 20:04:15 -07:00
parent d533f0ed95
commit 4b3b0b1ffd
2 changed files with 3 additions and 9 deletions

View File

@ -60,12 +60,6 @@ class Clone extends Post
@file.fullImage = $ '.full-image', file
@file.videoControls = $ '.video-controls', @file.text
# Restore old image thumbnail in quote preview for replaced WebMs
if !@file.thumb
@file.thumb = @file.oldThumb.cloneNode true
$.prepend $('.fileThumb', file), @file.thumb
delete @file.oldThumb
# Contract thumbnails in quote preview
ImageExpand.contract @ if contractThumb

View File

@ -10,7 +10,7 @@ ImageLoader =
if Conf['Replace WEBM'] and Conf['Autoplay']
$.on d, 'scroll visibilitychange', ->
g.posts.forEach (post) ->
if post.file?.oldThumb
if post.file?.videoThumb
{thumb} = post.file
visible = !d.hidden and Header.isNodeVisible thumb
if visible then thumb.play() else thumb.pause()
@ -30,7 +30,7 @@ ImageLoader =
node: (force) ->
return unless @file
{isImage, isVideo, thumb, URL} = @file
if @isClone and @file.oldThumb
if @isClone and @file.videoThumb
ImageLoader.play thumb
return if @isClone or @isHidden or @thread.isHidden or !(isImage or isVideo)
{style} = thumb
@ -69,7 +69,7 @@ ImageLoader =
if isVideo
$.on el, 'mouseover', ImageHover.mouseover if Conf['Image Hover']
$.replace thumb, el
file.oldThumb or= thumb
file.videoThumb = true
file.thumb = el
ImageLoader.play el unless post.isFetchedQuote
else