Retry if and only if we're sure the picture 404'd.
This commit is contained in:
parent
e319beae48
commit
fe45fcb4f0
@ -2734,15 +2734,18 @@
|
|||||||
return $.add(a, img);
|
return $.add(a, img);
|
||||||
},
|
},
|
||||||
error: function(e) {
|
error: function(e) {
|
||||||
var thumb;
|
var req, thumb;
|
||||||
thumb = this.previousSibling;
|
thumb = this.previousSibling;
|
||||||
imgExpand.contract(thumb);
|
imgExpand.contract(thumb);
|
||||||
if (!g.dead) {
|
req = $.ajax(this.src, null, 'head');
|
||||||
return setTimeout(imgExpand.retry, 10000, thumb);
|
return req.onreadystatechange = function(e) {
|
||||||
}
|
if (this.status !== 404) {
|
||||||
|
return setTimeout(imgExpand.retry, 10000, thumb);
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
retry: function(thumb) {
|
retry: function(thumb) {
|
||||||
if (!(g.dead || thumb.hidden)) {
|
if (!thumb.hidden) {
|
||||||
return imgExpand.expand(thumb);
|
return imgExpand.expand(thumb);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2026,10 +2026,10 @@ imgExpand =
|
|||||||
thumb = @previousSibling
|
thumb = @previousSibling
|
||||||
imgExpand.contract thumb
|
imgExpand.contract thumb
|
||||||
#navigator.online is not x-browser/os yet
|
#navigator.online is not x-browser/os yet
|
||||||
#can't easily check if the image/post is deleted
|
req = $.ajax @src, null, 'head'
|
||||||
setTimeout imgExpand.retry, 10000, thumb unless g.dead
|
req.onreadystatechange = (e) -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404
|
||||||
retry: (thumb) ->
|
retry: (thumb) ->
|
||||||
imgExpand.expand thumb unless g.dead or thumb.hidden
|
imgExpand.expand thumb unless thumb.hidden
|
||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
controls = $.el 'div',
|
controls = $.el 'div',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user