[FIX] point_of_sale: Support RTL languages

The layout of the printed tickets was wrong when using an RTL language.
We fix this and use an older version of html2canvas because the new one
introduced layout issues.
This commit is contained in:
Antoine Prieels
2019-09-06 09:12:25 +00:00
parent e5c66b758a
commit 1e06b56c84
3 changed files with 2839 additions and 6961 deletions
File diff suppressed because one or more lines are too long
@@ -1,5 +1,7 @@
.pos-receipt-print {
width: 512px;
text-align: left;
direction: ltr;
font-size: 28px;
padding-bottom: 2em;
color: #000000;
@@ -50,6 +50,7 @@ var PrinterMixin = {
$('.pos-receipts>.pos-receipt').addClass('pos-receipt-print');
var promise = new Promise(function (resolve, reject) {
html2canvas($('.pos-receipt-print')[0], {
background :'#FFFFFF',
ignoreElements: function (node) {
// By default, html2canvas copies the whole DOM even if we just capture a part
// of it. When copying the list of products, it gets all of the product from the
@@ -58,11 +59,12 @@ var PrinterMixin = {
return true;
}
return false;
}
}).then(function (canvas) {
$('.pos-receipts').empty();
resolve(self.process_canvas(canvas));
});
},
onrendered: function (canvas) {
$('.pos-receipts').empty();
resolve(self.process_canvas(canvas));
}
})
});
return promise;
},