Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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...
  • Loading branch information...
commit 8e9fca4fffeef8eaf7b8dbb2ffafe264c91bd6eb 1 parent bcc37dd
martinlanghoff authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/editor/htmlarea/htmlarea.php
View
9 lib/editor/htmlarea/htmlarea.php
@@ -802,13 +802,10 @@ function(event) {
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) {
+ 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;
Please sign in to comment.
Something went wrong with that request. Please try again.