Skip to content

Commit

Permalink
tinyMCE width and height
Browse files Browse the repository at this point in the history
tinyMCE plugin php
  • Loading branch information
schnuti committed Apr 2, 2017
1 parent e44f4e6 commit 8e95962
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/editors/tinymce/tinymce.php
Expand Up @@ -166,6 +166,16 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons
$doc = JFactory::getDocument();
$options = $doc->getScriptOptions('plg_editor_tinymce');

if (empty($width))
{
$width = "100%";
}

if (empty($height))
{
$height = "500px";
}

// Only add "px" to width and height if they are not given as a percentage
if (is_numeric($width))
{
Expand Down Expand Up @@ -395,14 +405,6 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons
$valid_elements = trim($levelParams->get('valid_elements', ''));
}

$html_height = $this->params->get('html_height', '550');
$html_width = $this->params->get('html_width', '');

if ($html_width == 750)
{
$html_width = '';
}

// 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);
Expand Down Expand Up @@ -652,8 +654,6 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons
'paste_data_images' => $allowImgPaste,
'importcss_append' => true,
'image_title' => true,
'height' => $html_height,
'width' => $html_width,
'resize' => $resizing,
'templates' => $templates,
'image_advtab' => (bool) $levelParams->get('image_advtab', false),
Expand Down

0 comments on commit 8e95962

Please sign in to comment.