diff options
Diffstat (limited to 'addons/web_editor/static/src/js/backend')
| -rw-r--r-- | addons/web_editor/static/src/js/backend/fields.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/backend/fields.js b/addons/web_editor/static/src/js/backend/fields.js index bf83e5b8dec..00c02e20513 100644 --- a/addons/web_editor/static/src/js/backend/fields.js +++ b/addons/web_editor/static/src/js/backend/fields.js @@ -309,6 +309,8 @@ var FieldTextHtml = AbstractField.extend({ old_initialize_content: function () { 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 = $(); @@ -324,6 +326,8 @@ var FieldTextHtml = AbstractField.extend({ this.render(); this.add_button(); this.loaded = true; + // 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(self.resize, 0); }, on_editor_loaded: function (EditorBar) { |
