[FIX] calendar: ok button on notifications should notify ack

Have an event starting *now* with a reminder, let's say 15 minutes

After saving the event, the notification pops up.

Click "OK"

Before this commit no call to the server was done, implying that the notification
will keep on popping up untimely
This was because, the widget was destroyed, hence its parents got removed
before the triggering up of rpc call

After this commit, we make sure we destroy the widget *after* the rpc

OPW 1860169
closes #25399
This commit is contained in:
Lucas Perais (lpe)
2018-06-22 11:19:00 +02:00
parent 8ace39f8bc
commit 72003ca530
@@ -40,8 +40,10 @@ var CalendarNotification = Notification.extend({
},
'click .link2showed': function() {
this.destroy(true);
this._rpc({route: '/calendar/notify_ack'});
var self = this;
this._rpc({route: '/calendar/notify_ack'}).always(function() {
self.destroy();
});
},
});
},