unexpanded images still being retried should be shown as expanding
This commit is contained in:
parent
d25a0cecfd
commit
09dee74ca5
@ -184,6 +184,7 @@ Gallery =
|
|||||||
if file.error?.code is MediaError.MEDIA_ERR_DECODE
|
if file.error?.code is MediaError.MEDIA_ERR_DECODE
|
||||||
return new Notice 'error', 'Corrupt or unplayable video', 30
|
return new Notice 'error', 'Corrupt or unplayable video', 30
|
||||||
ImageCommon.error g.posts[file.dataset.post], null, ->
|
ImageCommon.error g.posts[file.dataset.post], null, ->
|
||||||
|
return unless URL
|
||||||
thumb.href = URL
|
thumb.href = URL
|
||||||
file.src = URL if Gallery.nodes.current is file
|
file.src = URL if Gallery.nodes.current is file
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ ImageCommon =
|
|||||||
filename: post.file.URL
|
filename: post.file.URL
|
||||||
if URL and (/^https:\/\//.test(URL) or location.protocol is 'http:')
|
if URL and (/^https:\/\//.test(URL) or location.protocol is 'http:')
|
||||||
return cb URL
|
return cb URL
|
||||||
|
cb null # report nothing to retry
|
||||||
|
|
||||||
addControls: (video) ->
|
addControls: (video) ->
|
||||||
handler = ->
|
handler = ->
|
||||||
|
|||||||
@ -218,15 +218,18 @@ ImageExpand =
|
|||||||
post = Get.postFromNode @
|
post = Get.postFromNode @
|
||||||
$.rm @
|
$.rm @
|
||||||
delete post.file.fullImage
|
delete post.file.fullImage
|
||||||
|
if ImageCommon.decodeError @, post
|
||||||
|
ImageExpand.contract post
|
||||||
|
return
|
||||||
# Images can error:
|
# Images can error:
|
||||||
# - before the image started loading.
|
# - before the image started loading.
|
||||||
# - after 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.
|
||||||
# Don't try to re-expand if it was already contracted.
|
if post.file.isExpanding or post.file.isExpanded
|
||||||
return
|
ImageCommon.error post, 10 * $.SECOND, (URL) ->
|
||||||
ImageExpand.contract post
|
if post.file.isExpanding or post.file.isExpanded
|
||||||
return if ImageCommon.decodeError @, post
|
ImageExpand.contract post
|
||||||
ImageCommon.error post, 10 * $.SECOND, (URL) -> ImageExpand.expand post, URL
|
ImageExpand.expand post, URL if URL
|
||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
@ -44,4 +44,5 @@ ImageHover =
|
|||||||
return unless doc.contains @
|
return unless doc.contains @
|
||||||
post = g.posts[@dataset.fullID]
|
post = g.posts[@dataset.fullID]
|
||||||
return if ImageCommon.decodeError @, post
|
return if ImageCommon.decodeError @, post
|
||||||
ImageCommon.error post, 3 * $.SECOND, @src = URL
|
ImageCommon.error post, 3 * $.SECOND, ->
|
||||||
|
@src = URL if URL
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user