Fix image expanding fitness with an inlined backlink on Firefox, close #26

This commit is contained in:
Nicolas Stepien 2011-12-04 17:51:58 +01:00
parent ce1daf656e
commit 688cf8aa13
3 changed files with 8 additions and 7 deletions

View File

@ -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;

View File

@ -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

View File

@ -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