summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-11-30 14:44:49 +0100
committerChristophe Simonis <chs@odoo.com>2017-11-30 14:44:49 +0100
commit98539336a5d40de748764ff0a3c16d8cda77b02f (patch)
treec5b18d5375f4ac458546ff28b29445be9dce0549 /addons/web_editor/static/src/js/backend.js
parent92f7ecc263ffc252bbec71c9813e12f2933045a2 (diff)
parentb780e4a0e4389045979fdb82db34e09d4d672cbd (diff)
[MERGE] forward port branch saas-14 up to b780e4a0e43
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 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);