summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-03-17 15:51:13 +0000
committerJulien Mougenot <jum@odoo.com>2020-03-18 14:51:35 +0000
commitc9ce8a07e1d4f7253e4a889d659092d26477b8b6 (patch)
treea677f6c7c601668d1bc426271383c94ada443295 /addons/mail/static/src/js
parent3ad4abe171e8e7e86ed0e7b7f000e734d8a2ad92 (diff)
[REF] mail: update discuss helpers
Update the 'createDisuss' helper to be appended to the DOM using 'dom.prepend' to benefit of its 'on_(attach|detach)_callback' calls. This allows the mail test suite environment to be closer to the actual action behaviour (having those methods called each time it is created/destroyed). Some tests in which these methods were manually called have been adapted. Also, one of the tests was destroying the action too quickly and exposed an issue within the Discuss action, in the 'on_detach_callback' method. It has thus been fixed as well.
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/discuss.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/discuss.js b/addons/mail/static/src/js/discuss.js
index 79a13c307c8..7b56282565a 100644
--- a/addons/mail/static/src/js/discuss.js
+++ b/addons/mail/static/src/js/discuss.js
@@ -344,7 +344,9 @@ var Discuss = AbstractAction.extend({
on_detach_callback: function () {
this._super();
this.call('mail_service', 'getMailBus').trigger('discuss_open', false);
- this._threadsScrolltop[this._thread.getID()] = this._threadWidget.getScrolltop();
+ if (this._thread) {
+ this._threadsScrolltop[this._thread.getID()] = this._threadWidget.getScrolltop();
+ }
},
//--------------------------------------------------------------------------