diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2019-10-30 09:20:48 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-10-31 10:17:57 +0000 |
| commit | 9d2e3fcd61027745b809d2e06282e8e1374244ea (patch) | |
| tree | 3ec6815cf44e9efeb2d3cb8ed910026a0c5f0d40 /addons/web/static/src | |
| parent | 5e3d6c0032214c5eec92532070b1041c285b03c5 (diff) | |
[FIX] web: list: optional field dropdown expands toward the list
Be in RTL mode, on a list view
Click on the button to set up optional fields
Before this commit, the dropdown expanded to the right, and was partly invisible
After this commit, we dynamically set to which direction the dropdown should expand
depending on RTL/LTR
Consequently the dropdown is fully visible in either mode, and expands to the list
rather than away from it
closes #39402
closes odoo/odoo#39628
X-original-commit: fb914d176de5a4711f11de32945ebaec0164f62e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_renderer.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js index cedd0100295..2b90f4bfb2b 100644 --- a/addons/web/static/src/js/views/list/list_renderer.js +++ b/addons/web/static/src/js/views/list/list_renderer.js @@ -868,8 +868,15 @@ var ListRenderer = BasicRenderer.extend({ 'aria-expanded': false, }); $a.appendTo($optionalColumnsDropdown); + + // Set the expansion direction of the dropdown + // The button is located at the end of the list headers + // We want the dropdown to expand towards the list rather than away from it + // https://getbootstrap.com/docs/4.0/components/dropdowns/#menu-alignment + var direction = _t.database.parameters.direction; + var dropdownMenuClass = direction === 'rtl' ? 'dropdown-menu-left' : 'dropdown-menu-right'; var $dropdown = $("<div>", { - class: 'dropdown-menu dropdown-menu-right o_optional_columns_dropdown', + class: 'dropdown-menu o_optional_columns_dropdown ' + dropdownMenuClass, role: 'menu', }); this.optionalColumns.forEach(function (col) { |
