Started to rewrite CKEDITOR placeholder plugin for CKEDITOR5.

This commit is contained in:
Jan Böhmer 2022-07-29 01:03:17 +02:00
parent a33e93826a
commit eba89cee62
8 changed files with 374 additions and 1 deletions

View file

@ -16,6 +16,9 @@ class RichTextEditorType extends AbstractType
$resolver->setDefault('mode', 'markdown-full');
$resolver->setAllowedValues('mode', ['html-label', 'markdown-single_line', 'markdown-full']);
$resolver->setDefault('required', false);
}
public function getBlockPrefix()
@ -34,11 +37,15 @@ class RichTextEditorType extends AbstractType
{
$tmp = [];
//Set novalidate attribute or we will get problems that form can not be submitted as textarea is not focusable
$tmp['novalidate'] = 'novalidate';
$tmp['data-mode'] = $options['mode'];
//Add our data-controller element to the textarea
$tmp['data-controller'] = 'elements--ckeditor';
return $tmp;
}