From: Michael M Slusarz Date: Wed, 30 Jun 2010 17:45:39 +0000 (-0600) Subject: Fix compose textarea sizing in dimp X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e01cdf1a8758c95d8e75ebd5b574feae0eecc1a2;p=horde.git Fix compose textarea sizing in dimp --- diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index e0b9d65df..19a5e428d 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -693,10 +693,14 @@ var DimpCompose = { * row, and resize the textarea. */ rows = parseInt(mah / (msg.clientHeight / msg.readAttribute('rows')), 10); if (!isNaN(rows)) { - msg.writeAttribute({ rows: rows, disabled: false }); - if (de.scrollHeight - de.clientHeight) { - msg.writeAttribute('rows', rows - 1); - } + /* Due to the funky (broken) way some browsers (FF) count + * rows, we need to overshoot row estimate and increment + * downward until textarea size does not cause window + * scrolling. */ + ++rows; + do { + msg.writeAttribute({ rows: rows--, disabled: false }); + } while (de.scrollHeight - de.clientHeight); } } },