From 9e14d93c05895fa501d9eee9d75a87f17d6f5f89 Mon Sep 17 00:00:00 2001 From: Adrien Dieudonne Date: Mon, 30 Apr 2018 11:25:55 +0200 Subject: [PATCH] [FIX] barcodes: keep vertical position while scanning Before this commit, you were automatically redirected to the top of the page when you scanned a product. It was, therefore, difficult to find the product that had just been scanned and to check its quantity. Because of @3a74afd21 we need to put the focus in an invisible input at the top of the page. This input is now always vertically centered in the middle of the page. --- addons/barcodes/static/src/js/barcode_events.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index 71e07030ffd..88ed3ce814c 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -61,7 +61,9 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, { name: 'barcode', type: 'text', css: { - 'position': 'absolute', + 'position': 'fixed', + 'top': '50%', + 'transform': 'translateY(-50%)', 'opacity': 0, }, });