Added workaround for bug with CKEdito being too tall

This commit is contained in:
Andreas Stöckel 2010-05-31 11:44:08 +00:00
parent f80f79a98a
commit 8bbcafe1c0

View File

@ -586,12 +586,18 @@ class html
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/';