From 5732e215b0774c22d8e9bf210aa1491353595406 Mon Sep 17 00:00:00 2001 From: Jayden Smith Date: Thu, 9 Jun 2016 11:26:44 +1000 Subject: [PATCH] Allow passing of options into Rich Text Editor. --- CONTRIBUTORS.rst | 1 + wagtail/wagtailadmin/rich_text.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index c5e08ab5f..1d2fd1346 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -165,6 +165,7 @@ Contributors * Luiz Boaretto * Jonathon Moore * Kees Hink +* Jayden Smith Translators =========== diff --git a/wagtail/wagtailadmin/rich_text.py b/wagtail/wagtailadmin/rich_text.py index 115c72cac..8978e7c89 100644 --- a/wagtail/wagtailadmin/rich_text.py +++ b/wagtail/wagtailadmin/rich_text.py @@ -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)