diff options
Diffstat (limited to 'addons/web_editor/static')
| -rw-r--r-- | addons/web_editor/static/src/js/backend.js | 11 |
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); |
