summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-11-30 15:27:59 +0100
committerChristophe Simonis <chs@odoo.com>2017-11-30 15:27:59 +0100
commitab084d580ff0edf9be1d12cec87aeffdd84459b7 (patch)
tree6a19b4656315d94b65c88507bb471ac56d16f3ed /addons/web_editor/static/src/js/backend.js
parent3f66814a0d01a81bef5456a07da4b1ac8e2281e7 (diff)
parent98539336a5d40de748764ff0a3c16d8cda77b02f (diff)
[MERGE] forward port branch saas-15 up to 98539336a5d
Diffstat (limited to 'addons/web_editor/static/src/js/backend.js')
-rw-r--r--addons/web_editor/static/src/js/backend.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 6b167c59edd..31e92228767 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -301,6 +301,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 = $();
@@ -316,6 +318,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) {