From f33e7b851d4598db064bd7cf16a6e4e6aa5e7bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Tue, 15 Oct 2019 09:16:08 +0000 Subject: [PATCH] [FIX] hr_org_chart: Position subordinate popover with rtl lang With a Right to Left lang. Go to an employee form view. Click on the small pill with the number of subordinates (in the org chart). The popover opens but on the right side of the window instead of next to the pill. Fixes #38722 closes odoo/odoo#38873 X-original-commit: 292d4e7ba6bde6970382c816e092892f64e58c73 Signed-off-by: lul-odoo --- addons/hr_org_chart/static/src/js/hr_org_chart.js | 2 +- .../hr_org_chart/static/src/scss/hr_org_chart.scss | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/addons/hr_org_chart/static/src/js/hr_org_chart.js b/addons/hr_org_chart/static/src/js/hr_org_chart.js index 688456eae74..085df1faa4a 100644 --- a/addons/hr_org_chart/static/src/js/hr_org_chart.js +++ b/addons/hr_org_chart/static/src/js/hr_org_chart.js @@ -106,7 +106,7 @@ var FieldOrgChart = AbstractField.extend({ '.o_employee_redirect', _.bind(self._onEmployeeRedirect, self)); return $title; }, - container: 'body', + container: this, placement: 'left', trigger: 'focus', content: function () { diff --git a/addons/hr_org_chart/static/src/scss/hr_org_chart.scss b/addons/hr_org_chart/static/src/scss/hr_org_chart.scss index 7449f2adc6a..8c4d9d8960d 100644 --- a/addons/hr_org_chart/static/src/scss/hr_org_chart.scss +++ b/addons/hr_org_chart/static/src/scss/hr_org_chart.scss @@ -256,6 +256,7 @@ // POP OVER .o_org_chart_popup.popover { max-width: 400px; + margin-right: 5px; .popover-header { height: 47px; @@ -280,3 +281,14 @@ margin-bottom: 0; } } + +// Right to Left specific style to flip the popover arrow +.o_rtl { + .o_org_chart_popup.popover .arrow { + left: 100%; + -webkit-transform: matrix(-1, 0, 0, 1, 0, 0); + -moz-transform: matrix(-1, 0, 0, 1, 0, 0); + -o-transform: matrix(-1, 0, 0, 1, 0, 0); + transform: matrix(-1, 0, 0, 1, 0, 0); + } +}