Skip to content

Commit

Permalink
[FIX] web, account: fix RTL popover on invoice
Browse files Browse the repository at this point in the history
Reproduce the issue

    - Load Arabic language
    - Install Accounting
    - Create an invoice & add credit note
    - Switch to arabic
    - Click on the "(i)" icon near the total price

    The popover is displayed at the other side of the screen

Cause

    - RTLcss was reversing the "left: 0" css property to "right: 0"
    - The popover configuration was not adapted for RTL

This commit ignore RTL for the popover css "left" property and
configure correctly the JS side

OPW-2146210

closes #41200

X-original-commit: 88f03f0
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
  • Loading branch information
Jason Van Malder committed Dec 2, 2019
1 parent 1e6b256 commit eefa19f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addons/account/static/src/js/account_payment_field.js
Expand Up @@ -7,7 +7,7 @@ var field_registry = require('web.field_registry');
var field_utils = require('web.field_utils');

var QWeb = core.qweb;

var _t = core._t;

var ShowPaymentLineWidget = AbstractField.extend({
events: _.extend({
Expand Down Expand Up @@ -55,6 +55,7 @@ var ShowPaymentLineWidget = AbstractField.extend({
title: info.title
}));
_.each(this.$('.js_payment_info'), function (k, v){
var isRTL = _t.database.parameters.direction === "rtl";
var content = info.content[v];
var options = {
content: function () {
Expand All @@ -76,7 +77,7 @@ var ShowPaymentLineWidget = AbstractField.extend({
return $content;
},
html: true,
placement: 'left',
placement: isRTL ? 'bottom' : 'left',
title: 'Payment Information',
trigger: 'focus',
delay: { "show": 0, "hide": 100 },
Expand Down
5 changes: 5 additions & 0 deletions addons/web/static/src/scss/bootstrap_review.scss
Expand Up @@ -84,3 +84,8 @@
.btn:not(:disabled):not(.disabled) {
cursor: pointer;
}

// Disable RTL for the popover position
.popover {
right: auto#{"/*rtl:ignore*/"};
}

0 comments on commit eefa19f

Please sign in to comment.