Skip to content

Commit

Permalink
Merge pull request genemu#223 from joelwurtz/patch-2
Browse files Browse the repository at this point in the history
Fix html5 bug when textarea is required
  • Loading branch information
bamarni committed Jan 17, 2013
2 parents deabf36 + 6dfc22f commit f786c30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Resources/views/Form/jquery_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@
{%- if configs.script_url is defined %}
$('#{{ id }}').tinymce($configs);
var $textarea = jQuery('#{{ id }}');
if($textarea.is('[required]')) {
$configs.oninit = function(editor) {
editor.onChange.add(function(ed, l) { ed.save(); });
};
}
$textarea.tinymce($configs);
{% else %}
tinyMCE.init($configs);
Expand Down

0 comments on commit f786c30

Please sign in to comment.