Allow passing of options into Rich Text Editor.

This commit is contained in:
Jayden Smith 2016-06-09 11:26:44 +10:00 committed by Matt Westcott
parent e1c3a751ca
commit 5732e215b0
2 changed files with 7 additions and 1 deletions

View file

@ -165,6 +165,7 @@ Contributors
* Luiz Boaretto
* Jonathon Moore
* Kees Hink
* Jayden Smith
Translators
===========

View file

@ -54,4 +54,9 @@ def get_rich_text_editor_widget(name='default'):
editor_settings = getattr(settings, 'WAGTAILADMIN_RICH_TEXT_EDITORS', DEFAULT_RICH_TEXT_EDITORS)
editor = editor_settings[name]
return import_string(editor['WIDGET'])()
options = editor.get('OPTIONS', None)
if options is None:
return import_string(editor['WIDGET'])()
return import_string(editor['WIDGET'])(options=options)