mirror of https://github.com/OCA/web.git
[IMP] web_decimal_numpad_dot: fixed float widget not working properly
parent
ac4cdcfffc
commit
5cfd1a0f4b
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
var instance = openerp;
|
var instance = openerp;
|
||||||
|
|
||||||
instance.web.form.FieldFloat = instance.web.form.FieldChar.extend({
|
instance.web.form.FieldFloat = instance.web.form.FieldFloat.extend({
|
||||||
is_field_number: true,
|
render_value: function() {
|
||||||
widget_class: 'oe_form_field_float',
|
var self = this;
|
||||||
events: {
|
this._super();
|
||||||
"keypress": "floatKeypress",
|
if (!this.get('readonly')){
|
||||||
|
this.$el.find('input').on('keypress', this.floatKeypress.bind(this));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
floatKeypress: function(e){
|
floatKeypress: function(e){
|
||||||
if(e.keyCode == '46' || e.charCode == '46'){
|
if(e.keyCode == '46' || e.charCode == '46'){
|
||||||
|
@ -14,7 +16,7 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// Add the comma to the value of the input field
|
// Add the comma to the value of the input field
|
||||||
this.$("input").val(this.$("input").val() + ',');
|
this.$("input").val(this.$("input").val() + ',');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue