Permalink
Browse files

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.
  • Loading branch information...
1 parent 2dd8e07 commit ab7005bfa43510e384f71df81ce5dda47827a0e8 martinlanghoff committed Nov 12, 2007
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/editor/htmlarea/htmlarea.php
@@ -801,12 +801,18 @@ function(event) {
var width = (this.config.width == "auto" ? (this._toolbar.offsetWidth) : this.config.width);
width = Math.max(parseInt(width), 588);
+ 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;

0 comments on commit ab7005b

Please sign in to comment.