cache error handler should handle video errors that can occur during removal
This commit is contained in:
parent
f99a818554
commit
24e5676717
@ -134,16 +134,16 @@ ImageExpand =
|
|||||||
window.scrollBy 0, d.body.clientHeight - oldHeight
|
window.scrollBy 0, d.body.clientHeight - oldHeight
|
||||||
|
|
||||||
if el = file.fullImage
|
if el = file.fullImage
|
||||||
delete file.fullImage
|
|
||||||
$.off el, 'error', ImageExpand.error
|
$.off el, 'error', ImageExpand.error
|
||||||
|
ImageCommon.pushCache el
|
||||||
if file.isVideo
|
if file.isVideo
|
||||||
el.pause()
|
el.pause()
|
||||||
for eventName, cb of ImageExpand.videoCB
|
for eventName, cb of ImageExpand.videoCB
|
||||||
$.off el, eventName, cb
|
$.off el, eventName, cb
|
||||||
|
ImageCommon.rewind post, el
|
||||||
|
delete file.fullImage
|
||||||
$.rm el
|
$.rm el
|
||||||
$.rmClass el, 'full-image'
|
$.rmClass el, 'full-image'
|
||||||
ImageCommon.rewind post, el
|
|
||||||
ImageCommon.pushCache el
|
|
||||||
|
|
||||||
expand: (post, src) ->
|
expand: (post, src) ->
|
||||||
# Do not expand images of hidden/filtered replies, or already expanded pictures.
|
# Do not expand images of hidden/filtered replies, or already expanded pictures.
|
||||||
|
|||||||
@ -54,13 +54,12 @@ ImageHover =
|
|||||||
height: scale * height + padding
|
height: scale * height + padding
|
||||||
noRemove: true
|
noRemove: true
|
||||||
cb: ->
|
cb: ->
|
||||||
if isVideo
|
|
||||||
el.pause()
|
|
||||||
$.rm el
|
|
||||||
$.off el, 'error', error
|
$.off el, 'error', error
|
||||||
|
ImageCommon.pushCache el
|
||||||
|
el.pause() if isVideo
|
||||||
|
$.rm el
|
||||||
el.removeAttribute 'id'
|
el.removeAttribute 'id'
|
||||||
el.removeAttribute 'style'
|
el.removeAttribute 'style'
|
||||||
ImageCommon.pushCache el
|
|
||||||
error: (post) -> ->
|
error: (post) -> ->
|
||||||
return if ImageCommon.decodeError @, post
|
return if ImageCommon.decodeError @, post
|
||||||
ImageCommon.error @, post, 3 * $.SECOND, (URL) =>
|
ImageCommon.error @, post, 3 * $.SECOND, (URL) =>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user