[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
This commit is contained in:
Christophe Matthieu
2016-03-10 16:31:56 +01:00
parent 75048eae13
commit 7ca31fdcde
+7 -4
View File
@@ -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);