summaryrefslogtreecommitdiff
path: root/addons/web_editor
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-11-28 12:08:34 +0100
committerChristophe Simonis <chs@odoo.com>2017-11-28 12:08:34 +0100
commit77545387500c8e7ee5a0020deccf941f8e7b7677 (patch)
treefbf7bf9ddb5a3599b70f87f5ef2b13c38377dfcd /addons/web_editor
parentf20df81c20e96e9c517ee6fb1905ce9d5c9cc12f (diff)
parentcae188514fa8b0a7c785a630ac4aff677b2071fa (diff)
[MERGE] forward port branch 9.0 up to cae188514fa
Diffstat (limited to 'addons/web_editor')
-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 7d22186c0a8..f4f8d7144b6 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -296,6 +296,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 = $();
@@ -321,6 +323,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);