Fix image expanding fitness with an inlined backlink on Firefox, close #26
This commit is contained in:
parent
ce1daf656e
commit
688cf8aa13
@ -2873,15 +2873,15 @@
|
|||||||
return $.rm(thumb.nextSibling);
|
return $.rm(thumb.nextSibling);
|
||||||
},
|
},
|
||||||
expand: function(thumb) {
|
expand: function(thumb) {
|
||||||
var a, filesize, img, max, _, _ref;
|
var a, filesize, img, max;
|
||||||
a = thumb.parentNode;
|
a = thumb.parentNode;
|
||||||
img = $.el('img', {
|
img = $.el('img', {
|
||||||
src: a.href
|
src: a.href
|
||||||
});
|
});
|
||||||
if (engine === 'gecko' && a.parentNode.className !== 'op') {
|
if (engine === 'gecko' && a.parentNode.className !== 'op') {
|
||||||
filesize = $('.filesize', a.parentNode);
|
filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent;
|
||||||
_ref = filesize.textContent.match(/(\d+)x/), _ = _ref[0], max = _ref[1];
|
max = filesize.match(/(\d+)x/);
|
||||||
img.style.maxWidth = "" + max + "px";
|
img.style.maxWidth = "" + max[1] + "px";
|
||||||
}
|
}
|
||||||
$.on(img, 'error', imgExpand.error);
|
$.on(img, 'error', imgExpand.error);
|
||||||
thumb.hidden = true;
|
thumb.hidden = true;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
master
|
master
|
||||||
- mayhem
|
- mayhem
|
||||||
change 'Duckroll' for 'Cross-thread'
|
change 'Duckroll' for 'Cross-thread'
|
||||||
|
fix image expanding fitness with an inlined backlink on Firefox
|
||||||
|
|
||||||
2.22.0
|
2.22.0
|
||||||
- mayhem
|
- mayhem
|
||||||
|
|||||||
@ -2208,9 +2208,9 @@ imgExpand =
|
|||||||
img = $.el 'img',
|
img = $.el 'img',
|
||||||
src: a.href
|
src: a.href
|
||||||
if engine is 'gecko' and a.parentNode.className isnt 'op'
|
if engine is 'gecko' and a.parentNode.className isnt 'op'
|
||||||
filesize = $ '.filesize', a.parentNode
|
filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent
|
||||||
[_, max] = filesize.textContent.match /(\d+)x/
|
max = filesize.match /(\d+)x/
|
||||||
img.style.maxWidth = "#{max}px"
|
img.style.maxWidth = "#{max[1]}px"
|
||||||
$.on img, 'error', imgExpand.error
|
$.on img, 'error', imgExpand.error
|
||||||
thumb.hidden = true
|
thumb.hidden = true
|
||||||
$.add a, img
|
$.add a, img
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user