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