Browse Source
Merge pull request #1158 from Tecnativa/11.0-web_decimal_numpad_dot-fix_keyboard_navigation
[FIX] web_decimal_numpad_dot: Restore keyboard navigation
pull/1164/head
Pedro M. Baeza
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
9 deletions
-
web_decimal_numpad_dot/static/src/js/numpad_dot.js
|
|
@ -7,13 +7,6 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) { |
|
|
|
var translation = require("web.translation"); |
|
|
|
|
|
|
|
var NumpadDotReplaceMixin = { |
|
|
|
init: function () { |
|
|
|
this.events = $.extend({}, this.events, { |
|
|
|
"keydown": "numpad_dot_replace", |
|
|
|
}); |
|
|
|
return this._super.apply(this, arguments); |
|
|
|
}, |
|
|
|
|
|
|
|
l10n_decimal_point: function () { |
|
|
|
return this.formatType === "float_time" |
|
|
|
? ":" : translation._t.database.parameters.decimal_point; |
|
|
@ -24,10 +17,10 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) { |
|
|
|
cur_val.substring(to); |
|
|
|
}, |
|
|
|
|
|
|
|
numpad_dot_replace: function (event) { |
|
|
|
_onKeydown: function (event) { |
|
|
|
// Only act on numpad dot key
|
|
|
|
if (event.keyCode !== 110) { |
|
|
|
return; |
|
|
|
return this._super.apply(this, arguments); |
|
|
|
} |
|
|
|
event.preventDefault(); |
|
|
|
var from = this.$input.prop("selectionStart"), |
|
|
|