From be336adf8a56877caf1bc3f050eb3c1258f1c775 Mon Sep 17 00:00:00 2001 From: Roel Adriaans Date: Wed, 16 Dec 2015 10:45:30 +0100 Subject: [PATCH] web_decimal_numpad_dot: use the decimal_point defined in user language --- web_decimal_numpad_dot/static/src/js/numpad_dot.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web_decimal_numpad_dot/static/src/js/numpad_dot.js b/web_decimal_numpad_dot/static/src/js/numpad_dot.js index 55f9917c..560ce048 100644 --- a/web_decimal_numpad_dot/static/src/js/numpad_dot.js +++ b/web_decimal_numpad_dot/static/src/js/numpad_dot.js @@ -11,12 +11,18 @@ } }, floatKeypress: function(e){ - if(e.keyCode == '46' || e.charCode == '46'){ - //Cancel the keypress + if (e.keyCode == '46' || e.charCode == '46') { + // Cancel the keypress e.preventDefault(); // Add the comma to the value of the input field - this.$("input").val(this.$("input").val() + ','); + this.$("input").val(this.$("input").val() + instance.web._t.database.parameters.decimal_point); } + else if (e.keyCode == '44' || e.charCode == '44') { + // Cancel the keypress + e.preventDefault(); + // Add the comma to the value of the input field + this.$("input").val(this.$("input").val() + instance.web._t.database.parameters.thousands_sep); + } }, }); })();