widgets must have both setValue and getValue methods to be state stored/recalled

This commit is contained in:
jean-emmanuel 2016-03-14 18:33:40 +01:00
parent b5d4606019
commit 64bad5d8f4

View file

@ -30,7 +30,7 @@ module.exports = {
var data = []
$.each(WIDGETS,function(i,widget) {
for (var j=widget.length-1;j>=0;j--) {
if (widget[j].getValue) {
if (widget[j].setValue && widget[j].getValue) {
var v = widget[j].getValue()
if (v!=undefined) data.push(i+' '+v)
break
@ -72,7 +72,7 @@ module.exports = {
setTimeout(function(){
if (WIDGETS[data[0]]!=undefined) {
for (var i=WIDGETS[data[0]].length-1;i>=0;i--) {
if (WIDGETS[data[0]][i].setValue) {
if (WIDGETS[data[0]][i].setValue && WIDGETS[data[0]][i].getValue) {
WIDGETS[data[0]][i].setValue(data[1].split(','),send,true)
break
}