summaryrefslogtreecommitdiff
path: root/addons/website_mass_mailing
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-04-28 09:23:37 +0000
committerSamuel Degueldre <sad@odoo.com>2020-07-01 16:09:07 +0000
commit2387699233e2c91d47804a5039925829f9546611 (patch)
treea9dcf491d9bf72942c6403aa340c3dd6d785edb8 /addons/website_mass_mailing
parent9a1e1e6c3bff7d7cf14c7c396009f7e417e45a21 (diff)
[FIX] website_mass_mailing: fix input disappearing when duplicating
Previously, duplicating a block inside of the newsletter popup would cause the subscribe input and button to disappear. Actually, it disappears when you use most options of the left panel, because selecting an option refreshes the public widgets, which destroys them and starts them again, but for some reason, the subscribe widget's destroy method makes it d-none, but only removes that class if the subscribe input is not inside of a modal. This commit fixes that by not using d-none on the subscribe input group at all. We keep the d-none removals for databases which may have the button saved in a disabled state. task-2244780 closes odoo/odoo#53927 X-original-commit: 5562e7dbf5205c9b3ea0ef2d5283f3ccc5fbc30e Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website_mass_mailing')
-rw-r--r--addons/website_mass_mailing/static/src/js/website_mass_mailing.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.js
index 2212a707038..7a5a4f6c037 100644
--- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.js
+++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.js
@@ -50,6 +50,7 @@ publicWidget.registry.subscribe = publicWidget.Widget.extend({
self.$('input.js_subscribe_email')
.val(data.email || "")
.prop('disabled', isSubscriber);
+ // Compat: remove d-none for DBs that have the button saved with it.
self.$target.removeClass('d-none');
self.$('.js_subscribe_btn').toggleClass('d-none', !!isSubscriber);
self.$('.js_subscribed_btn').toggleClass('d-none', !isSubscriber);
@@ -61,15 +62,6 @@ publicWidget.registry.subscribe = publicWidget.Widget.extend({
},
}).then(always).guardedCatch(always)]);
},
- /**
- * @override
- */
- destroy: function () {
- if (!this.editableMode) {
- this.$target.addClass('d-none');
- }
- this._super.apply(this, arguments);
- },
//--------------------------------------------------------------------------
// Handlers