From fa5f51f1df5113e5832f44bfa4c5a0d6baafc454 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 22 Jan 2013 20:19:18 +0100 Subject: [PATCH] Fix image expanding. --- 4chan_x.user.js | 4 ++-- changelog | 2 ++ script.coffee | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 3f9f64251..3feacc991 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -5139,7 +5139,7 @@ } thumb.hidden = true; $.addClass(thumb.parentNode.parentNode.parentNode, 'image_expanded'); - if (img = thumb.nextSibling) { + if ((img = thumb.nextSibling) && img.nodeName === 'IMG') { img.hidden = false; return; } @@ -5147,7 +5147,7 @@ src: src }); $.on(img, 'error', ImageExpand.error); - return $.add(a, img); + return $.after(thumb, img); }, error: function() { var src, thumb, timeoutID, url; diff --git a/changelog b/changelog index 2a54aad3f..26ae45ae8 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Fix image expanding. 2.37.5 - Mayhem diff --git a/script.coffee b/script.coffee index e0f5f3de2..5e14de5dd 100644 --- a/script.coffee +++ b/script.coffee @@ -4152,13 +4152,13 @@ ImageExpand = return if /\.pdf$/.test src thumb.hidden = true $.addClass thumb.parentNode.parentNode.parentNode, 'image_expanded' - if img = thumb.nextSibling + if (img = thumb.nextSibling) && img.nodeName is 'IMG' # Expand already loaded picture img.hidden = false return img = $.el 'img', { src } $.on img, 'error', ImageExpand.error - $.add a, img + $.after thumb, img error: -> thumb = @previousSibling