Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
BasicUI: set widget value regardless of whether or not visibility has…
Browse files Browse the repository at this point in the history
… changed (#3958)

Signed-off-by: Vlad Ivanov <vlad@ivanov.email>
  • Loading branch information
vlad-ivanov-name authored and kaikreuzer committed Aug 5, 2017
1 parent 74a486d commit 025aa7d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
37 changes: 22 additions & 15 deletions extensions/ui/org.eclipse.smarthome.ui.basic/web-src/smarthome.js
Expand Up @@ -1742,22 +1742,29 @@
widget: widget,
visibility: data.visibility
});
} else {
widget.setValue(smarthome.UI.escapeHtml(value), data.item.state);
if (data.label !== undefined) {
widget.setLabel(data.label);
}
if (data.labelcolor !== undefined) {
widget.setLabelColor(data.labelcolor);
} else {
widget.setLabelColor("");
}
if (data.valuecolor !== undefined) {
widget.setValueColor(data.valuecolor);
} else {
widget.setValueColor("");
}
}

widget.setValue(smarthome.UI.escapeHtml(value), data.item.state);

[{
apply: widget.setLabel,
data: data.label,
fallback: null
}, {
apply: widget.setLabelColor,
data: data.labelcolor,
fallback: ""
}, {
apply: widget.setValueColor,
data: data.valuecolor,
fallback: ""
}].forEach(function(e) {
if (e.data !== undefined) {
e.apply(e.data);
} else if (e.fallback !== null) {
e.apply(e.fallback);
}
});
}
});

Expand Down

0 comments on commit 025aa7d

Please sign in to comment.