only one thumb per root

This commit is contained in:
James Campos 2011-07-10 20:57:13 -07:00
parent 2857f35042
commit b33e25ac76
2 changed files with 18 additions and 28 deletions

View File

@ -2482,32 +2482,24 @@
imgPreloading = { imgPreloading = {
init: function() { init: function() {
return g.callbacks.push(function(root) { return g.callbacks.push(function(root) {
var el, parent, thumb, thumbs, _i, _len, _results; var el, src, thumb;
thumbs = $$('img[md5]', root); thumb = $('img[md5]', root);
_results = []; src = thumb.parentNode.href;
for (_i = 0, _len = thumbs.length; _i < _len; _i++) { return el = $.el('img', {
thumb = thumbs[_i]; src: src
parent = thumb.parentNode; });
_results.push(el = $.el('img', {
src: parent.href
}));
}
return _results;
}); });
} }
}; };
imgGif = { imgGif = {
init: function() { init: function() {
return g.callbacks.push(function(root) { return g.callbacks.push(function(root) {
var src, thumb, thumbs, _i, _len, _results; var src, thumb;
thumbs = $$('img[md5]', root); thumb = $('img[md5]', root);
_results = []; src = thumb.parentNode.href;
for (_i = 0, _len = thumbs.length; _i < _len; _i++) { if (/gif$/.test(src)) {
thumb = thumbs[_i]; return thumb.src = src;
src = thumb.parentNode.href;
_results.push(/gif$/.test(src) ? thumb.src = src : void 0);
} }
return _results;
}); });
} }
}; };

View File

@ -1877,19 +1877,17 @@ imageHover =
imgPreloading = imgPreloading =
init: -> init: ->
g.callbacks.push (root) -> g.callbacks.push (root) ->
thumbs = $$ 'img[md5]', root thumb = $ 'img[md5]', root
for thumb in thumbs src = thumb.parentNode.href
parent = thumb.parentNode el = $.el 'img', { src }
el = $.el 'img', src: parent.href
imgGif = imgGif =
init: -> init: ->
g.callbacks.push (root) -> g.callbacks.push (root) ->
thumbs = $$ 'img[md5]', root thumb = $ 'img[md5]', root
for thumb in thumbs src = thumb.parentNode.href
src = thumb.parentNode.href if /gif$/.test src
if /gif$/.test src thumb.src = src
thumb.src = src
imgExpand = imgExpand =
init: -> init: ->