Don't keep running waitExpand's asap func when the image error'd.

This commit is contained in:
Mayhem 2014-04-09 10:20:32 +02:00
parent 06e6f84867
commit 662cff6396
2 changed files with 5 additions and 3 deletions

View File

@ -677,6 +677,9 @@ a.hide-announcement {
:root.gecko.fit-width .full-image {
width: 100%;
}
.fileThumb > .warning {
clear: both;
}
#ihover {
-moz-box-sizing: border-box;
box-sizing: border-box;

View File

@ -119,7 +119,7 @@ ImageExpand =
file = post.file.fullImage
if post.file.isImage
$.asap (-> file.naturalHeight), ->
$.asap (-> if post.file.isExpanding then file.naturalHeight else true), ->
ImageExpand.completeExpand post
return
@ -135,10 +135,9 @@ ImageExpand =
$.on file, 'loadeddata', complete
completeExpand: (post) ->
post.file.isReady = true
{thumb} = post.file
return unless post.file.isExpanding # contracted before the image loaded
delete post.file.isExpanding
post.file.isReady = true
post.file.isExpanded = true
unless post.nodes.root.parentNode
# Image might start/finish loading before the post is inserted.