Replace auto-GIF thumbnails once the GIF has finished loading.
This commit is contained in:
parent
bf54dff77b
commit
5c8c7be4ba
@ -3556,10 +3556,16 @@
|
|||||||
return g.callbacks.push(this.node);
|
return g.callbacks.push(this.node);
|
||||||
},
|
},
|
||||||
node: function(root) {
|
node: function(root) {
|
||||||
var src, thumb;
|
var img, src, thumb;
|
||||||
if (root.hidden || !(thumb = $('img[md5]', root))) return;
|
if (root.hidden || !(thumb = $('img[md5]', root))) return;
|
||||||
src = thumb.parentNode.href;
|
src = thumb.parentNode.href;
|
||||||
if (/gif$/.test(src) && !/spoiler/.test(src)) return thumb.src = src;
|
if (/gif$/.test(src) && !/spoiler/.test(src)) {
|
||||||
|
img = $.el('img');
|
||||||
|
$.on(img, 'load', function() {
|
||||||
|
return thumb.src = src;
|
||||||
|
});
|
||||||
|
return img.src = src;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2862,7 +2862,11 @@ imgGif =
|
|||||||
return if root.hidden or !thumb = $ 'img[md5]', root
|
return if root.hidden or !thumb = $ 'img[md5]', root
|
||||||
src = thumb.parentNode.href
|
src = thumb.parentNode.href
|
||||||
if /gif$/.test(src) and !/spoiler/.test src
|
if /gif$/.test(src) and !/spoiler/.test src
|
||||||
thumb.src = src
|
img = $.el 'img'
|
||||||
|
$.on img, 'load', ->
|
||||||
|
# Replace the thumbnail once the GIF has finished loading.
|
||||||
|
thumb.src = src
|
||||||
|
img.src = src
|
||||||
|
|
||||||
imgExpand =
|
imgExpand =
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user