ImageExpand.expand: return if pdf
This commit is contained in:
parent
cc04f1b9e9
commit
92adcaf28a
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user