unexpanded images still being retried should be shown as expanding

This commit is contained in:
ccd0 2014-07-27 03:00:23 -07:00
parent d25a0cecfd
commit 09dee74ca5
4 changed files with 13 additions and 7 deletions

View File

@ -184,6 +184,7 @@ Gallery =
if file.error?.code is MediaError.MEDIA_ERR_DECODE
return new Notice 'error', 'Corrupt or unplayable video', 30
ImageCommon.error g.posts[file.dataset.post], null, ->
return unless URL
thumb.href = URL
file.src = URL if Gallery.nodes.current is file

View File

@ -42,6 +42,7 @@ ImageCommon =
filename: post.file.URL
if URL and (/^https:\/\//.test(URL) or location.protocol is 'http:')
return cb URL
cb null # report nothing to retry
addControls: (video) ->
handler = ->

View File

@ -218,15 +218,18 @@ ImageExpand =
post = Get.postFromNode @
$.rm @
delete post.file.fullImage
if ImageCommon.decodeError @, post
ImageExpand.contract post
return
# Images can error:
# - before the image started loading.
# - after the image started loading.
unless post.file.isExpanding or post.file.isExpanded
# Don't try to re-expand if it was already contracted.
return
ImageExpand.contract post
return if ImageCommon.decodeError @, post
ImageCommon.error post, 10 * $.SECOND, (URL) -> ImageExpand.expand post, URL
# Don't try to re-expand if it was already contracted.
if post.file.isExpanding or post.file.isExpanded
ImageCommon.error post, 10 * $.SECOND, (URL) ->
if post.file.isExpanding or post.file.isExpanded
ImageExpand.contract post
ImageExpand.expand post, URL if URL
menu:
init: ->

View File

@ -44,4 +44,5 @@ ImageHover =
return unless doc.contains @
post = g.posts[@dataset.fullID]
return if ImageCommon.decodeError @, post
ImageCommon.error post, 3 * $.SECOND, @src = URL
ImageCommon.error post, 3 * $.SECOND, ->
@src = URL if URL