mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX HTMLEditorField::setRows minimal hieght (#10965)
This commit is contained in:
parent
ad8cf9902c
commit
ff3a6f72df
@ -114,19 +114,22 @@ class HTMLEditorField extends TextareaField
|
|||||||
|
|
||||||
public function getAttributes()
|
public function getAttributes()
|
||||||
{
|
{
|
||||||
|
$config = $this->getEditorConfig();
|
||||||
// Fix CSS height based on rows
|
// Fix CSS height based on rows
|
||||||
$rowHeight = $this->config()->get('fixed_row_height');
|
$rowHeight = $this->config()->get('fixed_row_height');
|
||||||
$attributes = [];
|
$attributes = [];
|
||||||
if ($rowHeight) {
|
if ($rowHeight && ($config instanceof TinyMCEConfig)) {
|
||||||
$height = $this->getRows() * $rowHeight;
|
$height = $this->getRows() * $rowHeight;
|
||||||
$attributes['style'] = sprintf('height: %dpx;', $height);
|
$attributes['style'] = sprintf('height: %dpx;', $height);
|
||||||
|
$config = clone $config;
|
||||||
|
$config->setOption('height', 'auto');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge attributes
|
// Merge attributes
|
||||||
return array_merge(
|
return array_merge(
|
||||||
$attributes,
|
$attributes,
|
||||||
parent::getAttributes(),
|
parent::getAttributes(),
|
||||||
$this->getEditorConfig()->getAttributes()
|
$config->getAttributes()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user