Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
888 B

var InputNumber = require('domain_abstract/ui/InputNumber');
module.exports = require('./PropertyView').extend({
template(model) {
const pfx = this.pfx;
return `
<div class="${pfx}label">
${this.templateLabel(model)}
</div>
`;
},
init() {
const model = this.model;
this.listenTo(model, 'change:unit', this.modelValueChanged);
this.listenTo(model, 'el:change', this.elementUpdated);
},
setValue(value) {
this.inputInst.setValue(value, {silent: 1});
},
onRender() {
if (!this.input) {
const inputNumber = new InputNumber({
model: this.model,
ppfx: this.ppfx
});
const input = inputNumber.render();
this.$el.append(input.$el);
this.$input = input.inputEl;
this.$unit = input.unitEl;
this.input = this.$input.get(0);
this.inputInst = input;
}
},
});