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