diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-08-22 15:44:39 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-08-23 11:27:55 +0200 |
| commit | 0fb82ab34e0e68f226397c872a6760ecf0472734 (patch) | |
| tree | ce13d19e0c12a6f2a48e3d17de7ee65baf47315d /addons/web_editor/static/src/js/backend | |
| parent | c5c53c8b6d1e900cd141091a90b39abcc29179d5 (diff) | |
[FIX] web_editor, *: allow editor dialogs in simple HTML areas
* website_forum
Summernote is instantiated as a simple text editor for 'simple' HTML
backend fields and in website_forum. In those cases, the user was not
able to open editor dialogs anymore as their opening was now handled
by the RTE widget in web_editor since the recent website refactoring.
The goal was to use `this._rpc` in these dialogs (and this required the
dialogs to be attached to the widget parenting system).
As a fix, a new component was implemented to handle these dialog
openings and this component is thus created by the RTE widget and the
other places that need the feature. The right fix would be a better
integration of the summernote editor in the parenting system but this
requires a lot more work than this commit, this will be the goal of the
future editor refactoring.
Diffstat (limited to 'addons/web_editor/static/src/js/backend')
| -rw-r--r-- | addons/web_editor/static/src/js/backend/fields.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/backend/fields.js b/addons/web_editor/static/src/js/backend/fields.js index ab4828fe89d..2486fea9b81 100644 --- a/addons/web_editor/static/src/js/backend/fields.js +++ b/addons/web_editor/static/src/js/backend/fields.js @@ -7,6 +7,7 @@ var config = require('web.config'); var core = require('web.core'); var session = require('web.session'); var field_registry = require('web.field_registry'); +var SummernoteManager = require('web_editor.rte.summernote'); var transcoder = require('web_editor.transcoder'); var TranslatableFieldMixin = basic_fields.TranslatableFieldMixin; @@ -25,6 +26,14 @@ var FieldTextHtmlSimple = basic_fields.DebouncedField.extend(TranslatableFieldMi className: 'oe_form_field oe_form_field_html_text', supportedFieldTypes: ['html'], + /** + * @override + */ + start: function () { + new SummernoteManager(this); + return this._super.apply(this, arguments); + }, + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- |
