summaryrefslogtreecommitdiff
path: root/addons/website_mail/static/src
diff options
context:
space:
mode:
authorVincent Schippefilt <vsc@odoo.com>2019-03-06 14:02:36 +0100
committerAaron Bohy <aab@odoo.com>2019-03-06 20:07:17 +0100
commit5413686837e810925234e339724da13fba684790 (patch)
tree7f0ace7594cd04c9328bb68aad48caa1acc86fb8 /addons/website_mail/static/src
parentbd88240d3fc981913a81f193882afc2e7c86bc2a (diff)
[REF] website_mail: adapt code after jQuery update
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Diffstat (limited to 'addons/website_mail/static/src')
-rw-r--r--addons/website_mail/static/src/js/follow.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/addons/website_mail/static/src/js/follow.js b/addons/website_mail/static/src/js/follow.js
index 8e6f18e8139..a6b4dcc6777 100644
--- a/addons/website_mail/static/src/js/follow.js
+++ b/addons/website_mail/static/src/js/follow.js
@@ -10,18 +10,21 @@ publicWidget.registry.follow = publicWidget.Widget.extend({
start: function () {
var self = this;
this.is_user = false;
+
+ var always = function (data) {
+ self.is_user = data.is_user;
+ self.email = data.email;
+ self.toggle_subscription(data.is_follower, data.email);
+ self.$target.removeClass('d-none');
+ };
+
this._rpc({
route: '/website_mail/is_follower',
params: {
model: this.$target.data('object'),
res_id: this.$target.data('id'),
},
- }).always(function (data) {
- self.is_user = data.is_user;
- self.email = data.email;
- self.toggle_subscription(data.is_follower, data.email);
- self.$target.removeClass('d-none');
- });
+ }).then(always).guardedCatch(always);
// not if editable mode to allow designer to edit
if (!this.editableMode) {