diff --git a/4chan_x.js b/4chan_x.js index bd07b76d3..7e5c70377 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2121,7 +2121,8 @@ imgExpand = { init: function() { g.callbacks.push(imgExpand.cb.node); - return imgExpand.dialog(); + imgExpand.dialog(); + return $.addStyle("body.fitheight img[md5] + img { max-height: " + d.body.clientHeight + "px }"); }, cb: { node: function(root) { @@ -2416,10 +2417,7 @@ }\ body.fitwidth img[md5] + img {\ max-width: 100%;\ - }\ - body.fitheight img[md5] + img {\ - /* FIXME max height = height of thread. we want height of viewport */\ - max-height: 100%;\ + width: -moz-calc(100%); /* hack so only firefox sees this */\ }\ \ iframe {\ diff --git a/script.coffee b/script.coffee index e84ab5628..6f161cbd7 100644 --- a/script.coffee +++ b/script.coffee @@ -1637,6 +1637,8 @@ imgExpand = init: -> g.callbacks.push imgExpand.cb.node imgExpand.dialog() + #FIXME add a resize listener + $.addStyle "body.fitheight img[md5] + img { max-height: #{d.body.clientHeight}px }" cb: node: (root) -> @@ -1887,10 +1889,7 @@ main = } body.fitwidth img[md5] + img { max-width: 100%; - } - body.fitheight img[md5] + img { - /* FIXME max height = height of thread. we want height of viewport */ - max-height: 100%; + width: -moz-calc(100%); /* hack so only firefox sees this */ } iframe {