summaryrefslogtreecommitdiff
path: root/addons/barcodes/static/src/js/barcode_events.js
diff options
context:
space:
mode:
authorArthur Maniet <arthurmaniet@me.com>2015-07-09 10:41:42 +0200
committerArthur Maniet <arthurmaniet@me.com>2015-07-30 07:55:52 +0200
commit47262c85872abe100c30dd71b800e5577a6fb8fe (patch)
tree7081ba0869c5c1e880577d975420dd9c2095c15d /addons/barcodes/static/src/js/barcode_events.js
parent5b01eca5e4ffc2dc453a3a85c9e753236a18d6e7 (diff)
[REF] barcodes: make key repeat prevention optional
This functionality was an attemps to fix the chair-to-keyboard interface in the PoS. Since it is not a standard behaviour, it must be explicitly requested.
Diffstat (limited to 'addons/barcodes/static/src/js/barcode_events.js')
-rw-r--r--addons/barcodes/static/src/js/barcode_events.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js
index d4306532cb9..96ccb51a1af 100644
--- a/addons/barcodes/static/src/js/barcode_events.js
+++ b/addons/barcodes/static/src/js/barcode_events.js
@@ -130,10 +130,12 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, {
}
},
- start: function(){
+ start: function(prevent_key_repeat){
document.body.addEventListener('keypress', this.__handler, true);
- document.body.addEventListener('keydown', this.__keydown_handler, true);
- document.body.addEventListener('keyup', this.__keyup_handler, true);
+ if (prevent_key_repeat === true) {
+ document.body.addEventListener('keydown', this.__keydown_handler, true);
+ document.body.addEventListener('keyup', this.__keyup_handler, true);
+ }
},
stop: function(){