diff --git a/4chan_x.user.js b/4chan_x.user.js index a67c1bb2c..24c70ca1a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2873,15 +2873,15 @@ return $.rm(thumb.nextSibling); }, expand: function(thumb) { - var a, filesize, img, max, _, _ref; + var a, filesize, img, max; a = thumb.parentNode; img = $.el('img', { src: a.href }); if (engine === 'gecko' && a.parentNode.className !== 'op') { - filesize = $('.filesize', a.parentNode); - _ref = filesize.textContent.match(/(\d+)x/), _ = _ref[0], max = _ref[1]; - img.style.maxWidth = "" + max + "px"; + filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent; + max = filesize.match(/(\d+)x/); + img.style.maxWidth = "" + max[1] + "px"; } $.on(img, 'error', imgExpand.error); thumb.hidden = true; diff --git a/changelog b/changelog index 66033bbdb..1f083a29e 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - mayhem change 'Duckroll' for 'Cross-thread' + fix image expanding fitness with an inlined backlink on Firefox 2.22.0 - mayhem diff --git a/script.coffee b/script.coffee index 93124fa1d..ed2013b20 100644 --- a/script.coffee +++ b/script.coffee @@ -2208,9 +2208,9 @@ imgExpand = img = $.el 'img', src: a.href if engine is 'gecko' and a.parentNode.className isnt 'op' - filesize = $ '.filesize', a.parentNode - [_, max] = filesize.textContent.match /(\d+)x/ - img.style.maxWidth = "#{max}px" + filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent + max = filesize.match /(\d+)x/ + img.style.maxWidth = "#{max[1]}px" $.on img, 'error', imgExpand.error thumb.hidden = true $.add a, img