Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.1] Fix TinyMCE height for multiple editor instances #37964

Merged
merged 2 commits into from Jun 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 22 additions & 7 deletions plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php
Expand Up @@ -84,19 +84,34 @@ public function onDisplay(
$editor .= !$this->app->client->mobile ? LayoutHelper::render('joomla.tinymce.togglebutton') : '';
$editor .= '</div>';

// Prepare the instance specific options, actually the ext-buttons
if (empty($options['tinyMCE'][$fieldName]['joomlaExtButtons']))
// Prepare the instance specific options
if (empty($options['tinyMCE'][$fieldName]))
{
$btns = $this->tinyButtons($id, $buttons);
// Width and height
if ($width)
{
$options['tinyMCE'][$fieldName]['width'] = $width;
}

if ($height)
{
$options['tinyMCE'][$fieldName]['height'] = $height;
}

// Set editor to readonly mode
if (!empty($params['readonly']))
{
$options['tinyMCE'][$fieldName]['readonly'] = 1;
}

$options['tinyMCE'][$fieldName]['joomlaMergeDefaults'] = true;
$options['tinyMCE'][$fieldName]['joomlaExtButtons'] = $btns;
// The ext-buttons
if (empty($options['tinyMCE'][$fieldName]['joomlaExtButtons']))
{
$btns = $this->tinyButtons($id, $buttons);

$options['tinyMCE'][$fieldName]['joomlaMergeDefaults'] = true;
$options['tinyMCE'][$fieldName]['joomlaExtButtons'] = $btns;
}

$doc->addScriptOptions('plg_editor_tinymce', $options, false);
}
Expand Down Expand Up @@ -471,8 +486,8 @@ public function onDisplay(
'document_base_url' => Uri::root(true) . '/',
'image_caption' => true,
'importcss_append' => true,
'height' => $height ?: $this->params->get('html_height', '550px'),
'width' => $width ?: $this->params->get('html_width', ''),
'height' => $this->params->get('html_height', '550px'),
'width' => $this->params->get('html_width', ''),
'elementpath' => (bool) $levelParams->get('element_path', true),
'resize' => $resizing,
'templates' => $templates,
Expand Down