Skip to content

Commit ecf557c

Browse files
author
Alexis Beingessner
committed
Ticket OscarGodson#132 - adding IE support hack
1 parent 41fd59b commit ecf557c

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

epiceditor/js/epiceditor.js

+18-3
Original file line numberDiff line numberDiff line change
@@ -1729,15 +1729,30 @@
17291729
var editorHeight
17301730
, newHeight
17311731
, minHeight
1732-
, maxHeight;
1732+
, maxHeight
1733+
, el
1734+
, style
1735+
, _pxToInt;
17331736

17341737
//autogrow in fullscreen in nonsensical
17351738
if (!this.is("fullscreen")) {
17361739
if (this.is("edit")) {
1737-
editorHeight = this.getElement('editor').documentElement.scrollHeight;
1740+
el = this.getElement('editor');
17381741
}
17391742
else {
1740-
editorHeight = this.getElement('previewer').documentElement.scrollHeight;
1743+
el = this.getElement('previewer');
1744+
}
1745+
1746+
if (_isIE()) {
1747+
_pxToInt = function (val) {
1748+
return parseInt(val.substring(0, val.length - 2), 10);
1749+
}
1750+
style = window.getComputedStyle(el.documentElement, null);
1751+
editorHeight = el.body.scrollHeight + _pxToInt(style.getPropertyValue("padding-top")) + _pxToInt(style.getPropertyValue("padding-bottom")) +
1752+
_pxToInt(style.getPropertyValue("margin-top")) + _pxToInt(style.getPropertyValue("margin-bottom")) + 28;
1753+
}
1754+
else {
1755+
editorHeight = el.documentElement.scrollHeight;
17411756
}
17421757

17431758
newHeight = editorHeight;

0 commit comments

Comments
 (0)