diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2017-01-10 08:21:25 +0100 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2017-01-10 08:31:38 +0100 |
| commit | 3f7b1f608344fed2f79d08ec602a700ec34c70cb (patch) | |
| tree | 4a4b9bb09101dd7fa60a8c930c39b3a6b6c9f4f9 /addons/web_editor/static/src/js | |
| parent | 17adc2e09ec67ea4a2325b1cc5bfaf93e7d968c1 (diff) | |
[FIX] web_editor: ignore read only + debug + write
In some case (for example the one solved with b51d21c5) we can have
write done on a field text in read only mode.
With 98ed53ce if :
- such a case happened (in b51d21c5 the fix only worked after the given
field was written one time) or a similar instance,
- and the user was in debug mode,
- and the widget used was TextFieldHtmlSimple
this could lead to an issue with the code trying to toggle the code view
mode whilst the editor is closed.
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/rte.summernote.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 6110820de7d..869ece9cf58 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -494,13 +494,18 @@ function prettify_html(html) { * disable (false) or enable (true) the code view mode. */ $.summernote.pluginEvents.codeview = function (event, editor, layoutInfo, enable) { + if (layoutInfo === undefined) { + return; + } if (layoutInfo.toolbar) { + // if editor inline (FieldTextHtmlSimple) var is_activated = $.summernote.eventHandler.modules.codeview.isActivated(layoutInfo); if (is_activated === enable) { return; } return eventHandler.modules.codeview.toggle(layoutInfo); } else { + // if editor iframe (FieldTextHtml) var $editor = layoutInfo.editor(); var $textarea = $editor.prev('textarea'); if ($textarea.is('textarea') === enable) { |
