don't add error handler multiple times
This commit is contained in:
parent
6d5fec5dcb
commit
a995d5ecb1
@ -102,13 +102,15 @@ ImageExpand =
|
||||
|
||||
contract: (post) ->
|
||||
{thumb} = post.file
|
||||
if post.file.isVideo and video = post.file.fullImage
|
||||
video.pause()
|
||||
TrashQueue.add video, post
|
||||
thumb.parentNode.href = video.src
|
||||
if el = post.file.fullImage
|
||||
$.off el, 'error', ImageExpand.error
|
||||
if el and post.file.isVideo
|
||||
el.pause()
|
||||
TrashQueue.add el, post
|
||||
thumb.parentNode.href = el.src
|
||||
thumb.parentNode.target = '_blank'
|
||||
for eventName, cb of ImageExpand.videoCB
|
||||
$.off video, eventName, cb
|
||||
$.off el, eventName, cb
|
||||
$.rm post.file.videoControls
|
||||
delete post.file.videoControls
|
||||
$.rmClass post.nodes.root, 'expanded-image'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user