diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-03-07 15:02:05 +0100 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-03-07 15:11:01 +0100 |
| commit | 3c821d4035d0c85f691653c47986d8f4c3dfc51d (patch) | |
| tree | 4a0b14924ed64d3ef5403c79f55188792c06e53b /addons | |
| parent | 93ae1b1a041b6a36521263ff87ac980e6102551a (diff) | |
[FIX] mail: no traceback with attach/detach (discuss mobile)
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498
From the refactoring above, some snake_case attributes have been
converted into camelCase. That was the case in discuss.js, but
we missed to propagate the changes in discuss_mobile.js.
This commit fixes the traceback that came from the mistake above.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mail/static/src/js/discuss_mobile.js | 4 | ||||
| -rw-r--r-- | addons/mail/static/tests/discuss_mobile_tests.js | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/discuss_mobile.js b/addons/mail/static/src/js/discuss_mobile.js index 52622b0ce32..b427ab4b98c 100644 --- a/addons/mail/static/src/js/discuss_mobile.js +++ b/addons/mail/static/src/js/discuss_mobile.js @@ -41,7 +41,7 @@ Discuss.include({ */ on_attach_callback: function () { if (this.channel && this._isInInboxTab()) { - this.thread.scroll_to({offset: this.channels_scrolltop[this.channel.id]}); + this.thread.scroll_to({offset: this.channelsScrolltop[this.channel.id]}); } }, /** @@ -49,7 +49,7 @@ Discuss.include({ */ on_detach_callback: function () { if (this._isInInboxTab()) { - this.channels_scrolltop[this.channel.id] = this.thread.get_scrolltop(); + this.channelsScrolltop[this.channel.id] = this.thread.get_scrolltop(); } }, diff --git a/addons/mail/static/tests/discuss_mobile_tests.js b/addons/mail/static/tests/discuss_mobile_tests.js index d17364b53ad..921436d4657 100644 --- a/addons/mail/static/tests/discuss_mobile_tests.js +++ b/addons/mail/static/tests/discuss_mobile_tests.js @@ -65,6 +65,29 @@ QUnit.test('mobile basic rendering', function (assert) { }); }); +QUnit.test('on_{attach/detach}_callback', function (assert) { + assert.expect(2); + var done = assert.async(); + + createDiscuss({ + id: 1, + context: {}, + params: {}, + data: this.data, + services: this.services, + }).then(function (discuss) { + try { + discuss.on_attach_callback(); + assert.ok(true, 'should not crash on attach callback'); + discuss.on_detach_callback(); + assert.ok(true, 'should not crash on detach callback'); + } finally { + discuss.destroy(); + done(); + } + }); +}); + }); }); |
