diff --git a/plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php b/plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php index b8f8b630f00b0..f570b383f9886 100644 --- a/plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php +++ b/plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php @@ -65,8 +65,6 @@ public function onDisplay( $externalPlugins = []; $options = $doc->getScriptOptions('plg_editor_tinymce'); $theme = 'silver'; - $width = is_numeric($width) ? $width . 'px' : $width; - $height = is_numeric($height) ? $height . 'px' : $height; // Data object for the layout $textarea = new stdClass; @@ -75,8 +73,8 @@ public function onDisplay( $textarea->class = 'mce_editable joomla-editor-tinymce'; $textarea->cols = $col; $textarea->rows = $row; - $textarea->width = $width; - $textarea->height = $height; + $textarea->width = is_numeric($width) ? $width . 'px' : $width; + $textarea->height = is_numeric($height) ? $height . 'px' : $height; $textarea->content = $content; $textarea->readonly = !empty($params['readonly']); @@ -237,12 +235,6 @@ public function onDisplay( $valid_elements = trim($levelParams->get('valid_elements', '')); } - $html_height = $this->params->get('html_height', '550'); - $html_width = $this->params->get('html_width', ''); - $html_width = $html_width == 750 ? '' : $html_width; - $html_width = is_numeric($html_width) ? $html_width . 'px' : $html_width; - $html_height = is_numeric($html_height) ? $html_height . 'px' : $html_height; - // The param is true for vertical resizing only, false or both $resizing = (bool) $levelParams->get('resizing', true); $resize_horizontal = (bool) $levelParams->get('resize_horizontal', true); @@ -479,8 +471,8 @@ public function onDisplay( 'document_base_url' => Uri::root(true) . '/', 'image_caption' => true, 'importcss_append' => true, - 'height' => $html_height, - 'width' => $html_width, + 'height' => $height ?: $this->params->get('html_height', '550px'), + 'width' => $width ?: $this->params->get('html_width', ''), 'elementpath' => (bool) $levelParams->get('element_path', true), 'resize' => $resizing, 'templates' => $templates,