summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/rte.summernote.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2016-11-16 11:01:52 +0100
committerNicolas Lempereur <nle@odoo.com>2016-11-16 14:06:01 +0100
commit897290dd3ff218ddc12dcdc6c936a8725813cefe (patch)
tree99553f145814b3921191bb627465627e23ec7830 /addons/web_editor/static/src/js/rte.summernote.js
parent9f172a61e0f2c87ff97128c44f0ad3b5f6e869b6 (diff)
[IMP] web_editor: don't lose modified code view content
The scenario when using the code view is the following : - click on code view button to use code view - make changes - click on code view button to get back to wysiwyg view - save from the wysiwyg view If the 3rd step is not done: - for the inline editor, we lose the changes that have been done in code view, - for the iframe editor, we lose the entirety of the content. At one time the user was forced to go back to wysiwyg before being able to save, but this have been removed hence the present usability issue. With this fix, when the editor content is saved, if the user is in code view he is automatically set back to wysiwyg view. closes #14339 opw-693052
Diffstat (limited to 'addons/web_editor/static/src/js/rte.summernote.js')
-rw-r--r--addons/web_editor/static/src/js/rte.summernote.js2
1 files changed, 2 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 8cbb80583b7..b7d4c191b7e 100644
--- a/addons/web_editor/static/src/js/rte.summernote.js
+++ b/addons/web_editor/static/src/js/rte.summernote.js
@@ -485,6 +485,8 @@ function prettify_html(html) {
}
return result;
}
+
+// Change Warning: called with dummy arguments to quit code view before saving
$.summernote.pluginEvents.codeview = function (event, editor, layoutInfo) {
if (layoutInfo.toolbar) {
return eventHandler.modules.codeview.toggle(layoutInfo);