1 {% extends 'forms/base_widget.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>
10 {% block javascript %}
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');
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');
28 dialog
.dialog('option', 'position', dialog
.dialog('option', 'position'));