Fix fit width on Firefox. Close #105

This commit is contained in:
Nicolas Stepien 2011-05-21 00:27:43 +02:00
parent d4a8a8dcf9
commit f2ecb5c4c7
2 changed files with 10 additions and 1 deletions

View File

@ -2237,12 +2237,17 @@
return $.rm(thumb.nextSibling);
},
expand: function(thumb) {
var a, img;
var a, filesize, img, max, _, _ref2;
$.hide(thumb);
a = thumb.parentNode;
img = $.el('img', {
src: a.href
});
if (a.parentNode.className !== 'op') {
filesize = $.x('preceding::span[@class="filesize"][1]', a);
_ref2 = filesize.textContent.match(/(\d+)x/), _ = _ref2[0], max = _ref2[1];
img.setAttribute('style', "max-width: -moz-calc(" + max + "px);");
}
return a.appendChild(img);
},
dialog: function() {

View File

@ -1716,6 +1716,10 @@ imgExpand =
a = thumb.parentNode
img = $.el 'img',
src: a.href
unless a.parentNode.className is 'op'
filesize = $.x 'preceding::span[@class="filesize"][1]', a
[_, max] = filesize.textContent.match /(\d+)x/
img.setAttribute 'style', "max-width: -moz-calc(#{max}px);"
a.appendChild img
dialog: ->