--- a/svghmi/widget_button.ysl2 Wed Sep 30 12:31:59 2020 +0200
+++ b/svghmi/widget_button.ysl2 Thu Oct 01 14:23:27 2020 +0200
@@ -25,13 +25,15 @@
}
animate(){
- // redraw button on screen refresh
- if (this.state_hmi) {
- this.active_elt.setAttribute("style", this.active_style);
- this.inactive_elt.setAttribute("style", "display:none");
- } else {
- this.inactive_elt.setAttribute("style", this.inactive_style);
- this.active_elt.setAttribute("style", "display:none");
+ if (this.active_style && this.inactive_style) {
+ // redraw button on screen refresh
+ if (this.state_hmi) {
+ this.active_elt.setAttribute("style", this.active_style);
+ this.inactive_elt.setAttribute("style", "display:none");
+ } else {
+ this.inactive_elt.setAttribute("style", this.inactive_style);
+ this.active_elt.setAttribute("style", "display:none");
+ }
}
}