From 755a625d95b06c118d652395c62d974591d058af Mon Sep 17 00:00:00 2001
From: martinlanghoff <martinlanghoff>
Date: Mon, 12 Nov 2007 04:13:24 +0000
Subject: [PATCH] htmlarea: Fix fullscreen editor on IE6/7 -- MDL-11242

Only say px if the width is a pure number. Under IE we
get the "100%" for the width of the editor, so blindly
appending "px" results in a JS execution error.

With this patch we only attach px if it's a pure int.

Also tested the sizing of HTMLArea in the messaging
window. So both should be working now.
---
 lib/editor/htmlarea/htmlarea.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/editor/htmlarea/htmlarea.php b/lib/editor/htmlarea/htmlarea.php
index a7f89b033c..0e682a3381 100644
--- a/lib/editor/htmlarea/htmlarea.php
+++ b/lib/editor/htmlarea/htmlarea.php
@@ -807,12 +807,18 @@ HTMLArea.prototype.generate = function () {
     var width = (this.config.width == "auto" ? (this._toolbar.offsetWidth) : this.config.width);
     // 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) {
         height -= 2;
         width -= 2;
     }
 
-    iframe.style.width = width + "px";
+    iframe.style.width = width;
+
     if (this.config.sizeIncludesToolbar) {
         // substract toolbar height
         height -= this._toolbar.offsetHeight;
-- 
2.39.5