htmlarea: fix in FF - MDL-11242

The previous fix for IE left some problems in the FF side of
things because we were trying additions/substractions on
width once its had turned to a string of value + unit.

Do the math before we attach 'px' to it...
This commit is contained in:
martinlanghoff
2007-11-14 01:24:40 +00:00
parent cfb5feb8b5
commit b21ca22e1f
+3 -6
View File
@@ -808,13 +808,10 @@ HTMLArea.prototype.generate = function () {
// width = Math.max(parseInt(width), 598);
width = String(width);
if (width.match(/^\d+$/)) { // is this a pure int? if so, let it be in px
width=width+"px";
}
if (!HTMLArea.is_ie) {
if (width.match(/^\d+$/)) { // is this a pure int? if so, let it be in px, and remove 2px
height -= 2;
width -= 2;
width -= 2;
width=width+"px";
}
iframe.style.width = width;