Replace auto-GIF thumbnails once the GIF has finished loading.

This commit is contained in:
Nicolas Stepien 2012-02-29 18:54:23 +01:00
parent bf54dff77b
commit 5c8c7be4ba
2 changed files with 13 additions and 3 deletions

View File

@ -3556,10 +3556,16 @@
return g.callbacks.push(this.node);
},
node: function(root) {
var src, thumb;
var img, src, thumb;
if (root.hidden || !(thumb = $('img[md5]', root))) return;
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;
}
}
};

View File

@ -2862,7 +2862,11 @@ imgGif =
return if root.hidden or !thumb = $ 'img[md5]', root
src = thumb.parentNode.href
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 =
init: ->