summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-02-14 18:09:24 +0100
committerChristophe Simonis <chs@odoo.com>2019-02-14 18:09:24 +0100
commitc1fe9f18d5a1f6c13548ea2af964bde40b3b6861 (patch)
tree811d2b54d9d6867741ffd6ce26e3baf292d4e1fb /addons/web_editor/static/src
parent18228f9c4e1642a3c0afb24223bccfb3354c928a (diff)
parent69719f598aad2eb8ff87687bc47900030688f0ce (diff)
[MERGE] forward port branch 10.0 up to 69719f598aa
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/backend.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 1c5feb7a7d4..884ef68d674 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -57,7 +57,8 @@ var FieldTextHtmlSimple = widget.extend({
this.$translate.remove();
this.$translate = $();
// Triggers a mouseup to refresh the editor toolbar
- this.$content.trigger('mouseup');
+ var mouseupEvent = $.Event('mouseup', {'setStyleInfoFromEditable': true});
+ this.$content.trigger(mouseupEvent);
return def;
},
initialize_content: function () {
@@ -170,7 +171,11 @@ var FieldTextHtmlSimple = widget.extend({
transcoder.class_to_style(this.$content);
transcoder.font_to_img(this.$content);
}
- this.internal_set_value(this.$content.html());
+ var value = this.$content.html();
+ if (this.get('value') === false && value === '<p><br></p>') {
+ value = false;
+ }
+ this.internal_set_value(value);
},
destroy_content: function () {
$(".oe-view-manager-content").off("scroll");