diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php
index 81a06930d7..ce7942bc8d 100644
--- a/phpgwapi/inc/class.html.inc.php
+++ b/phpgwapi/inc/class.html.inc.php
@@ -585,13 +585,19 @@ class html
// run content through htmlpurifier
if ($_purify && !empty($_content)) $_content = self::purify($_content);
$oCKeditor = self::initCKEditor($_height, $_mode);
-
- return $oCKeditor->editor($_name, $_content);
+
+ /* Resize the editor to the actual size delivered by the $_height parameter once it is initialized */
+ $pxheight = (strpos('px', $_height) === false) ? (empty($_height)?400:$_height) : str_replace('px', '', $_height);
+ $events['instanceReady'] = 'function (ev) {
+ ev.editor.resize("100%", '.str_replace('px', '', $pxheight).');
+ }';
+
+ return $oCKeditor->editor($_name, $_content, null, $events);
}
static function &initCKEditor($_height, $_mode)
{
- include_once(EGW_INCLUDE_ROOT."/phpgwapi/js/ckeditor3/ckeditor.php");
+ include_once(EGW_INCLUDE_ROOT."/phpgwapi/js/ckeditor3/ckeditor_php5.php");
//Get the ckeditor base url
$basePath = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/ckeditor3/';