formula: add split option

This commit is contained in:
jean-emmanuel 2017-01-24 20:38:22 +01:00
parent c8110deeaa
commit 3b65f4f7a6

View file

@ -30,6 +30,7 @@ module.exports = class Formula extends _widgets_base {
precision:2,
address:'auto',
split:[]
preArgs:[],
target:[]
}
@ -46,6 +47,8 @@ module.exports = class Formula extends _widgets_base {
super(...arguments, widgetHtml)
this.split = typeof widgetData.split == 'object' && widgetData.split.length ? widgetData.split : false
this.input = this.widget.find('.input').fakeInput({align:'center', disabled:true})
this.linkedWidgets = widgetData.formula.match(/\$\{([^\}]*)\}/g) == null ? [] : widgetData.formula.match(/\$\{([^\}]*)\}/g).map((a)=>{return a.substr(2, a.length - 3)})