From 10adbacd8aa5b62271a4ed0cc90d521346db9bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Tue, 15 Mar 2022 12:11:58 +0000 Subject: [PATCH] [IMP] mail: turn 'ChatWindow/shiftPrevText' into field Task-2793280 closes odoo/odoo#86435 Signed-off-by: Ooming --- .../chat_window_header/chat_window_header.js | 10 ---------- .../chat_window_header/chat_window_header.xml | 2 +- .../static/src/models/chat_window/chat_window.js | 13 +++++++++++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/addons/mail/static/src/components/chat_window_header/chat_window_header.js b/addons/mail/static/src/components/chat_window_header/chat_window_header.js index 0637391ca46..d1ef7d6ea10 100644 --- a/addons/mail/static/src/components/chat_window_header/chat_window_header.js +++ b/addons/mail/static/src/components/chat_window_header/chat_window_header.js @@ -21,16 +21,6 @@ export class ChatWindowHeader extends Component { return this.messaging && this.messaging.models['ChatWindow'].get(this.props.chatWindowLocalId); } - /** - * @returns {string} - */ - get shiftPrevText() { - if (this.messaging.locale.textDirection === 'rtl') { - return this.env._t("Shift right"); - } - return this.env._t("Shift left"); - } - //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- diff --git a/addons/mail/static/src/components/chat_window_header/chat_window_header.xml b/addons/mail/static/src/components/chat_window_header/chat_window_header.xml index e8bc331fc15..abe340c374e 100644 --- a/addons/mail/static/src/components/chat_window_header/chat_window_header.xml +++ b/addons/mail/static/src/components/chat_window_header/chat_window_header.xml @@ -56,7 +56,7 @@ -
+
diff --git a/addons/mail/static/src/models/chat_window/chat_window.js b/addons/mail/static/src/models/chat_window/chat_window.js index f5636257b67..9c3661fff0f 100644 --- a/addons/mail/static/src/models/chat_window/chat_window.js +++ b/addons/mail/static/src/models/chat_window/chat_window.js @@ -303,6 +303,16 @@ registerModel({ } return this.env._t("Shift right"); }, + /** + * @private + * @returns {string} + */ + _computeShiftPrevText() { + if (this.messaging.locale.textDirection === 'rtl') { + return this.env._t("Shift right"); + } + return this.env._t("Shift left"); + }, /** * @private * @returns {ThreadViewer} @@ -489,6 +499,9 @@ registerModel({ shiftNextText: attr({ compute: '_computeShiftNextText', }), + shiftPrevText: attr({ + compute: '_computeShiftPrevText', + }), /** * Determines the `Thread` that should be displayed by `this`. * If no `Thread` is linked, `this` is considered "new message".