Permalink
Browse files

Add readonly support to tinymce

  • Loading branch information...
flack committed Dec 4, 2018
1 parent 84a733a commit 6ef820721bf0334e3b40f4e664ebde57f7b5c8f4
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/midcom/datamanager/template/form.php
@@ -567,6 +567,10 @@ public function markdown_widget(FormView $view, array $data)
public function tinymce_widget(FormView $view, array $data)
{
if (!empty($data['attr']['readonly'])) {
$string = $this->get_view_renderer()->text_widget($view, $data);
return $string . $this->renderer->block($view, 'form_widget_simple', ['type' => "hidden"]);
}
//we set required to false, because tinymce doesn't play well with html5 validation..
$string = '<textarea' . $this->renderer->block($view, 'widget_attributes', ['required' => false]) . '>' . $data['value'] . '</textarea>';
return $string . $this->jsinit($data['tinymce_snippet']);

0 comments on commit 6ef8207

Please sign in to comment.