ImageExpand.expand: return if pdf

This commit is contained in:
James Campos 2013-01-15 23:28:56 -08:00
parent cc04f1b9e9
commit 92adcaf28a
2 changed files with 12 additions and 7 deletions

View File

@ -5127,20 +5127,24 @@
thumb.nextSibling.hidden = true;
return $.rmClass(thumb.parentNode.parentNode.parentNode, 'image_expanded');
},
expand: function(thumb, url) {
expand: function(thumb, src) {
var a, img;
if ($.x('ancestor-or-self::*[@hidden]', thumb)) {
return;
}
a = thumb.parentNode;
src || (src = a.href);
if (/\.pdf$/.test(src)) {
return;
}
thumb.hidden = true;
$.addClass(thumb.parentNode.parentNode.parentNode, 'image_expanded');
if (img = thumb.nextSibling) {
img.hidden = false;
return;
}
a = thumb.parentNode;
img = $.el('img', {
src: url || a.href
src: src
});
$.on(img, 'error', ImageExpand.error);
return $.add(a, img);

View File

@ -4144,18 +4144,19 @@ ImageExpand =
thumb.nextSibling.hidden = true
$.rmClass thumb.parentNode.parentNode.parentNode, 'image_expanded'
expand: (thumb, url) ->
expand: (thumb, src) ->
# Do not expand images of hidden/filtered replies, or already expanded pictures.
return if $.x 'ancestor-or-self::*[@hidden]', thumb
a = thumb.parentNode
src or= a.href
return if /\.pdf$/.test src
thumb.hidden = true
$.addClass thumb.parentNode.parentNode.parentNode, 'image_expanded'
if img = thumb.nextSibling
# Expand already loaded picture
img.hidden = false
return
a = thumb.parentNode
img = $.el 'img',
src: url or a.href
img = $.el 'img', { src }
$.on img, 'error', ImageExpand.error
$.add a, img