From 625e2f06be2582b6f8d983d7e25a6c8f73102424 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 6 Aug 2019 13:14:32 +0000 Subject: [PATCH] [FIX] web: kanban swipe in RTL - Set a language using RTL (e.g. Arabic) - Activate mobile mode (through debug mode or on a mobile device) - Go to a grouped kanban view (e.g. CRM pipeline) - Swipe to the left The column to the left if shown instead of the column to the right. In RTL, the kanban groups order are inverted. Therefore, we also need to invert the swipe direction. --- .../web/static/src/js/views/kanban/kanban_renderer_mobile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/views/kanban/kanban_renderer_mobile.js b/addons/web/static/src/js/views/kanban/kanban_renderer_mobile.js index 8619448e793..3961805c41e 100644 --- a/addons/web/static/src/js/views/kanban/kanban_renderer_mobile.js +++ b/addons/web/static/src/js/views/kanban/kanban_renderer_mobile.js @@ -112,12 +112,13 @@ KanbanRenderer.include({ _enableSwipe: function () { var self = this; var currentColumn = this.widgets[this.activeColumnIndex]; + var step = _t.database.parameters.direction === 'rtl' ? -1 : 1; currentColumn.$el.swipe({ swipeLeft: function () { - self._moveToGroup(self.activeColumnIndex + 1, self.ANIMATE); + self._moveToGroup(self.activeColumnIndex + step, self.ANIMATE); }, swipeRight: function () { - self._moveToGroup(self.activeColumnIndex - 1, self.ANIMATE); + self._moveToGroup(self.activeColumnIndex - step, self.ANIMATE); } }); },