diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-01-10 13:52:44 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-01-10 13:52:44 +0100 |
| commit | a2c1df8b9ca731107dd2d67cc0b2dd39d0c7ad64 (patch) | |
| tree | 5de4c414a1c137c674ca004fbec6a29fc1a10db5 /addons/web_editor/static/src/js/backend.js | |
| parent | d38e00031f975db4a3d3e80250d5142444a3239b (diff) | |
| parent | 557feb950cb74656c92e59a62847c9e414c9b41f (diff) | |
[MERGE] forward port branch saas-14 up to 557feb950cb
Diffstat (limited to 'addons/web_editor/static/src/js/backend.js')
| -rw-r--r-- | addons/web_editor/static/src/js/backend.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 9c6f1df5e8c..ce8643f04de 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -161,6 +161,11 @@ var FieldTextHtmlSimple = widget.extend({ return !this.get('value') || this.get('value') === "<p><br/></p>" || !this.get('value').match(/\S/); }, commit_value: function () { + /* Switch to WYSIWYG mode if currently in code view */ + if (session.debug) { + var layoutInfo = this.$textarea.data('layoutInfo'); + $.summernote.pluginEvents.codeview(undefined, undefined, layoutInfo, false); + } if (this.options['style-inline']) { transcoder.class_to_style(this.$content); transcoder.font_to_img(this.$content); @@ -377,6 +382,11 @@ var FieldTextHtml = widget.extend({ this._dirty_flag = false; return this.editor.save(); } else if (this._dirty_flag && this.editor && this.editor.buildingBlock) { + /* Switch to WYSIWYG mode if currently in code view */ + if (session.debug) { + var layoutInfo = this.editor.rte.editable().data('layoutInfo'); + $.summernote.pluginEvents.codeview(undefined, undefined, layoutInfo, false); + } this.editor.buildingBlock.clean_for_save(); this.internal_set_value( this.$content.html() ); } |
