Skip to content

Commit

Permalink
Allow passing of options into Rich Text Editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayden Smith authored and gasman committed Sep 14, 2016
1 parent e1c3a75 commit 5732e21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Expand Up @@ -165,6 +165,7 @@ Contributors
* Luiz Boaretto
* Jonathon Moore
* Kees Hink
* Jayden Smith

Translators
===========
Expand Down
7 changes: 6 additions & 1 deletion wagtail/wagtailadmin/rich_text.py
Expand Up @@ -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)

0 comments on commit 5732e21

Please sign in to comment.