diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-07-06 12:28:44 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-07-19 13:58:34 +0200 |
| commit | 55fc06c8676dd071fb7c1ade13062ae3d3c99d71 (patch) | |
| tree | da13cecb4911ffc1ae554a5208eaf344a820b4d2 /addons/mail/static/src/js/models/threads/thread.js | |
| parent | 99756a62d76eca2de91877c25acd73848e31616f (diff) | |
[FIX] mail: clean docstring
- updated docstring
- move function to abstract thread (generalization behaviour for all threads)
- simplify code
Diffstat (limited to 'addons/mail/static/src/js/models/threads/thread.js')
| -rw-r--r-- | addons/mail/static/src/js/models/threads/thread.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/models/threads/thread.js b/addons/mail/static/src/js/models/threads/thread.js index adf66d2ffcc..76d840a6100 100644 --- a/addons/mail/static/src/js/models/threads/thread.js +++ b/addons/mail/static/src/js/models/threads/thread.js @@ -16,20 +16,20 @@ var ServicesMixin = require('web.ServicesMixin'); * In particular, channels and mailboxes are two different kinds of threads. */ var Thread = AbstractThread.extend(Mixins.EventDispatcherMixin, ServicesMixin, { + /** * @override - * @param {Object} params * @param {mail.Manager} param.parent + * @param {Object} params * @param {Object} params.data * @param {string} [params.data.channel_type] * @param {string} params.data.name * @param {string} [params.data.type] */ init: function (params) { - this._super.apply(this, arguments); Mixins.EventDispatcherMixin.init.call(this, arguments); this.setParent(params.parent); - + this._super.apply(this, arguments); // threads are not detached by default this._detached = false; // if this._massMailing is set, display subject on messages, use @@ -100,14 +100,15 @@ var Thread = AbstractThread.extend(Mixins.EventDispatcherMixin, ServicesMixin, { return $.when([]); }, /** - * Updates the _folded state of the thread. Must be overriden to reflect + * Updates the folded state of the thread. Must be overriden to reflect * the new state in the interface. * + * @override * @param {boolean} boolean */ fold: function (folded) { - this._detached = true; - this._folded = folded; + this._super.apply(this, arguments); + this._detached = true; // auto-detach the thread this._warnUpdatedWindowState(); }, /** @@ -300,8 +301,7 @@ var Thread = AbstractThread.extend(Mixins.EventDispatcherMixin, ServicesMixin, { */ markAsRead: function () { if (this._unreadCounter > 0) { - this._unreadCounter = 0; - this._warnUpdatedUnreadCounter(); + this.resetUnreadCounter(); } return $.when(); }, |
