summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Dieudonne <adr@odoo.com>2018-04-30 11:25:55 +0200
committerAdrien Dieudonne <adr@odoo.com>2018-04-30 16:14:38 +0200
commit9e14d93c05895fa501d9eee9d75a87f17d6f5f89 (patch)
tree29367fe35aa9ce9723628ffd19c7fbe75dec6b73
parent29c29b4578d36c22b7b44b51d1d2c631be45722a (diff)
[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.
-rw-r--r--addons/barcodes/static/src/js/barcode_events.js4
1 files changed, 3 insertions, 1 deletions
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,
},
});