diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 94c6e8057c0..2b3c0e0790c 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -293,6 +293,8 @@ var FieldTextHtml = widget.extend({ var self = this; this.$el.closest('.modal-body').css('max-height', 'none'); this.$iframe = this.$el.find('iframe'); + // deactivate any button to avoid saving a not ready iframe + $('.o_cp_buttons, .o_statusbar_buttons').find('button').addClass('o_disabled').attr('disabled', true); this.document = null; this.$body = $(); this.$content = $(); @@ -318,6 +320,8 @@ var FieldTextHtml = widget.extend({ this.lang = this.lang ? this.lang[1] : this.view.dataset.context.lang; this._dirty_flag = false; this.render_value(); + // reactivate all the buttons when the field's content (the iframe) is loaded + $('.o_cp_buttons, .o_statusbar_buttons').find('button').removeClass('o_disabled').attr('disabled', false); setTimeout(function () { self.add_button(); setTimeout(self.resize,0);