cache error handler should handle video errors that can occur during removal

This commit is contained in:
ccd0 2014-09-27 12:42:41 -07:00
parent f99a818554
commit 24e5676717
2 changed files with 6 additions and 7 deletions

View File

@ -134,16 +134,16 @@ ImageExpand =
window.scrollBy 0, d.body.clientHeight - oldHeight
if el = file.fullImage
delete file.fullImage
$.off el, 'error', ImageExpand.error
ImageCommon.pushCache el
if file.isVideo
el.pause()
for eventName, cb of ImageExpand.videoCB
$.off el, eventName, cb
ImageCommon.rewind post, el
delete file.fullImage
$.rm el
$.rmClass el, 'full-image'
ImageCommon.rewind post, el
ImageCommon.pushCache el
expand: (post, src) ->
# Do not expand images of hidden/filtered replies, or already expanded pictures.

View File

@ -54,13 +54,12 @@ ImageHover =
height: scale * height + padding
noRemove: true
cb: ->
if isVideo
el.pause()
$.rm el
$.off el, 'error', error
ImageCommon.pushCache el
el.pause() if isVideo
$.rm el
el.removeAttribute 'id'
el.removeAttribute 'style'
ImageCommon.pushCache el
error: (post) -> ->
return if ImageCommon.decodeError @, post
ImageCommon.error @, post, 3 * $.SECOND, (URL) =>