From 4a5b93994cbfd1f95ef22038de2aca1e07de5b08 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Wed, 3 Jan 2024 11:31:24 +0100 Subject: [PATCH] [FIX] web_editor: make the row menu ui appear on left in RTL mode Before this commit, when the user was in RTL mode, the row menu UI was appearing on the right side of the table UI toggler, which would make it invisible to the user. This commit fixes the issue by making the row menu UI appear on the left of the table UI toggler in RTL mode. task-3664939 closes odoo/odoo#148543 X-original-commit: 25a9c993ff0bdbe30fca1e4306da9018a7ec836a Signed-off-by: Antoine Guenet (age) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index a144292943e..d6da953b59e 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -5032,6 +5032,15 @@ export class OdooEditor extends EventTarget { _onTableMenuTogglerClick(ev) { const uiWrapper = ev.target.closest('.o_table_ui'); uiWrapper.classList.toggle('o_open'); + + if (this.options.direction === 'rtl') { + const menuRowEl = this._tableUiContainer.querySelector('.o_row_ui .o_table_ui_menu') + const menuRowRect = menuRowEl.getBoundingClientRect(); + menuRowEl.style.position = 'absolute'; + menuRowEl.style.left = `-${menuRowRect.width}px`; + menuRowEl.style.margin = `0px`; + } + if (uiWrapper.classList.contains('o_column_ui')) { const columnIndex = getColumnIndex(this._columnUiTarget); uiWrapper.querySelector('.o_move_left').classList.toggle('o_hide', columnIndex === 0);