summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2015-12-01 10:54:51 +0100
committerMartin Trigaux <mat@odoo.com>2015-12-01 10:54:51 +0100
commit87f96c942ab4381b489db5b6bf5de959f0ec3d7f (patch)
treee9302d09e1fce1d4544e7fa92d4465105ded0140 /addons/web_editor/static/src/js
parentd025251c7e4ee4c26462e61b5d63e5c5d58689f8 (diff)
parent90254beedbb6a9bdf055ae582af866073eab4f2c (diff)
[MERGE] forward port of branch saas-7 up to 90254bee
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/backend.js2
-rw-r--r--addons/web_editor/static/src/js/summernote.js6
2 files changed, 7 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index e7c6d93853d..2c7c86466c1 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -122,8 +122,8 @@ var FieldTextHtmlSimple = widget.extend({
if (this.options['style-inline']) {
transcoder.class_to_style(this.$content);
transcoder.font_to_img(this.$content);
- this.internal_set_value(this.$content.html());
}
+ this.internal_set_value(this.$content.html());
},
destroy_content: function () {
$(".oe-view-manager-content").off("scroll");
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index c5a9b3ebbef..ff509800c50 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -2320,6 +2320,12 @@ function summernote_paste (event) {
var html = clipboardData.getData("text/html");
var $node = $('<div/>').html(html);
+ // if copying source did not provide html, default to plain text
+ if(!html) {
+ $node.text(clipboardData.getData("text/plain")).html(function(_, html){
+ return html.replace(/\r?\n/g,'<br>');
+ });
+ }
/*
remove undesirable tag