2
0
mirror of https://github.com/frappe/books.git synced 2024-09-21 03:39:02 +00:00
books/client/view/controls/float.js

20 lines
506 B
JavaScript
Raw Normal View History

const BaseControl = require('./base');
class FloatControl extends BaseControl {
make() {
super.make();
2018-02-21 09:43:21 +00:00
this.input.setAttribute('type', 'text');
2018-02-07 13:23:52 +00:00
this.input.classList.add('text-right');
this.input.addEventListener('focus', () => {
setTimeout(() => {
this.input.select();
}, 100);
})
}
2018-02-08 11:45:32 +00:00
parse(value) {
value = parseFloat(value);
return value===NaN ? 0 : value;
}
};
module.exports = FloatControl;