summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
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
parent7e9e2ada32757a5db45d21b57b789826218f0498 (diff)
parentc201cf2b77cf44e9ad15165ceadde41dfaa20ceb (diff)
[MERGE] forward port branch 11.0 up to c201cf2b77c
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/backend/fields.js4
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js4
2 files changed, 6 insertions, 2 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) {
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index 0ca3c6bef7b..05c6df465c6 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -469,7 +469,7 @@ var fontIconsDialog = Widget.extend({
e.stopPropagation();
this.$('#fa-icon').val(e.target.getAttribute('data-id'));
- $(".font-icons-icon").removeClass("o_selected");
+ this.$(".font-icons-icon").removeClass("o_selected");
$(e.target).addClass("o_selected");
},
'dblclick .font-icons-icon': function () {
@@ -595,7 +595,7 @@ var fontIconsDialog = Widget.extend({
continue;
case '': continue;
default:
- $(".font-icons-icon").removeClass("o_selected").filter("[data-alias*=',"+cls+",']").addClass("o_selected");
+ this.$(".font-icons-icon").removeClass("o_selected").filter("[data-alias*=',"+cls+",']").addClass("o_selected");
if (this.alias.indexOf(cls) !== -1) {
this.$('#fa-icon').val(cls);
}