summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-12-01 12:55:02 +0100
committerChristophe Simonis <chs@odoo.com>2017-12-01 12:55:02 +0100
commit2f9947045896b8dfeb9b7bf4771c904665d22b47 (patch)
tree70a47252612672e48005cb98b2072b680fa6b32f /addons/web_editor/static/src/js/backend
parent7e9e2ada32757a5db45d21b57b789826218f0498 (diff)
parentc201cf2b77cf44e9ad15165ceadde41dfaa20ceb (diff)
[MERGE] forward port branch 11.0 up to c201cf2b77c
Diffstat (limited to 'addons/web_editor/static/src/js/backend')
-rw-r--r--addons/web_editor/static/src/js/backend/fields.js4
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) {