[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) <age@odoo.com>
This commit is contained in:
Nicolas Bayet
2024-01-10 06:12:30 +00:00
parent e67b16fb79
commit 4a5b93994c
@@ -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);