From 5472cca160199cae3d867101fe401db767a3cedd Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 10 Feb 2020 14:18:41 +0000 Subject: [PATCH] :green_heart: eslint --fix --- pos_keyboard/static/src/js/pos.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pos_keyboard/static/src/js/pos.js b/pos_keyboard/static/src/js/pos.js index 5bc9bdb..d6b2b91 100644 --- a/pos_keyboard/static/src/js/pos.js +++ b/pos_keyboard/static/src/js/pos.js @@ -92,14 +92,11 @@ odoo.define('pos_keyboard.pos', function (require) { var type = this.pos.keypad.type; if (data.type === type.numchar){ this.state.appendNewChar(data.val); - } - else if (data.type === type.bmode) { + } else if (data.type === type.bmode) { this.state.changeMode(data.val); - } - else if (data.type === type.sign){ + } else if (data.type === type.sign){ this.clickSwitchSign(); - } - else if (data.type === type.backspace){ + } else if (data.type === type.backspace){ this.clickDeleteLastChar(); } } @@ -190,10 +187,10 @@ odoo.define('pos_keyboard.pos', function (require) { // KeyCode: Escape (Keypad 'esc') var KC_ESCAPE = 27; var kc_lookup = { - 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', + 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9', 80: 'p', 83: 's', 68: 'd', 190: '.', 81: 'q', - 96: '0', 97: '1', 98: '2', 99: '3', 100: '4', + 96: '0', 97: '1', 98: '2', 99: '3', 100: '4', 101: '5', 102: '6', 103: '7', 104: '8', 105: '9', 106: '*', 107: '+', 109: '-', 110: '.', 111: '/' }; @@ -203,7 +200,7 @@ odoo.define('pos_keyboard.pos', function (require) { var ok = false; var timeStamp = 0; $('body').on('keyup', '', function (e){ - var statusHandler = !rx.test(e.target.tagName) || + var statusHandler = !rx.test(e.target.tagName) || e.target.disabled || e.target.readOnly; if (statusHandler){ var is_number = false; @@ -259,7 +256,9 @@ odoo.define('pos_keyboard.pos', function (require) { timeStamp = new Date().getTime(); setTimeout(function(){ - if (ok) {self.action_callback(self.data);} + if (ok) { +self.action_callback(self.data); +} }, 50); } });