summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2016-03-09 09:52:12 +0100
committerChristophe Matthieu <chm@odoo.com>2016-03-10 16:31:56 +0100
commit7ca31fdcde9616b6b5876fa6f79fcc3835ccdccb (patch)
tree9b283fc4ed121587d172eb6db60f8665cef19be1
parent75048eae13064969e1f0fb61043f5c9ddc2d3a15 (diff)
[FIX] web_editor: don't display the html content field
issue: message, click on a record, return to the list view, click on an other record => nothing desplayed. opw-671047
-rw-r--r--addons/web_editor/static/src/js/backend.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 09ce4dda344..2a33cdd4758 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -67,12 +67,15 @@ var FieldTextHtmlSimple = widget.extend({
if (this.get("effective_readonly")) {
if (this.options['style-inline']) {
- this.$textarea.hide().after('<iframe class="o_readonly"/>');
- setTimeout(function () {
- self.$content = $("body", self.$('iframe').contents()[0]);
+ var $iframe = $('<iframe class="o_readonly"/>');
+ this.$textarea.hide().after($iframe);
+ var load = function () {
+ self.$content = $($iframe.contents()[0]).find("body");
self.$content.html(self.text_to_html(self.get('value')));
self.resize();
- });
+ };
+ setTimeout(load);
+ $iframe.on('load', load);
} else {
this.$content = $('<div class="o_readonly"/>');
this.$textarea.hide().after(this.$content);