2
0
mirror of https://github.com/frappe/books.git synced 2025-01-26 08:38:27 +00:00

20 lines
507 B
JavaScript
Raw Normal View History

const BaseControl = require('./base');
class FloatControl extends BaseControl {
make() {
super.make();
2018-02-21 15:13:21 +05:30
this.input.setAttribute('type', 'text');
2018-02-07 18:53:52 +05:30
this.input.classList.add('text-right');
this.input.addEventListener('focus', () => {
setTimeout(() => {
this.input.select();
}, 100);
})
}
2018-02-08 17:15:32 +05:30
parse(value) {
value = parseFloat(value);
2018-03-05 22:15:21 +05:30
return isNaN(value) ? 0 : value;
2018-02-08 17:15:32 +05:30
}
};
module.exports = FloatControl;