From 488cdf4d0af9a927cb6ada1e18b556f1639fa1a4 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 13 Jun 2011 00:17:34 +0200 Subject: [PATCH] style.maxWidth with -moz-calc() is working, it just doesn't appear on Chrome. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 0f2cc082f..f38c41f10 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2419,7 +2419,7 @@ if (a.parentNode.className !== 'op') { filesize = $('span.filesize', a.parentNode); _ref2 = filesize.textContent.match(/(\d+)x/), _ = _ref2[0], max = _ref2[1]; - img.setAttribute('style', "max-width: -moz-calc(" + max + "px);"); + img.style.maxWidth = "-moz-calc(" + max + "px)"; } return a.appendChild(img); }, diff --git a/script.coffee b/script.coffee index 7f70f0cb1..19adb312a 100644 --- a/script.coffee +++ b/script.coffee @@ -1812,7 +1812,7 @@ imgExpand = unless a.parentNode.className is 'op' filesize = $ 'span.filesize', a.parentNode [_, max] = filesize.textContent.match /(\d+)x/ - img.setAttribute 'style', "max-width: -moz-calc(#{max}px);" + img.style.maxWidth = "-moz-calc(#{max}px)" a.appendChild img dialog: ->