Increase ckeditor widget height (300px => 475px)
[cds-indico.git] / indico / web / templates / forms / ckeditor_widget.html
blob5498473011e8b7b7017ae26a0764684b7a17705d
1 {% extends 'forms/base_widget.html' %}
4 {% block html %}
5 <input type="hidden" name="{{ field.name }}" id="{{ field.id }}" value="{{ field._value() }}">
6 <div id="{{ field.id }}-editor" style="margin-bottom: 10px;"></div>
7 {% endblock %}
10 {% block javascript %}
11 <script>
12 (function() {
13 'use strict';
15 var field = $('#{{ field.id }}');
16 var editor = new RichTextEditor(600, 475, {{ simple | tojson }});
17 editor.set(field.val());
18 editor.onLoad(function() {
19 editor.onChange(function() {
20 field.val(editor.get()).trigger('change');
21 });
22 });
23 $E('{{ field.id }}-editor').set(editor.draw());
24 // Re-position the dialog if we have one since the initial position is
25 // wrong due to the editor being loaded after the dialog has been opened.
26 var dialog = field.closest('.ui-dialog-content');
27 if (dialog.length) {
28 dialog.dialog('option', 'position', dialog.dialog('option', 'position'));
30 })();
31 </script>
32 {% endblock %}