svghmi/widget_button.ysl2
branchsvghmi
changeset 3062 9ec338a99a18
parent 3059 e0db3f6a5f39
child 3085 6b1b23971960
equal deleted inserted replaced
3061:6dc33dae4074 3062:9ec338a99a18
    23             this.state_hmi = this.state_plc;
    23             this.state_hmi = this.state_plc;
    24             this.request_animate();
    24             this.request_animate();
    25         }
    25         }
    26 
    26 
    27         animate(){
    27         animate(){
    28            // redraw button on screen refresh
    28             if (this.active_style && this.inactive_style) {
    29            if (this.state_hmi) {
    29                // redraw button on screen refresh
    30                this.active_elt.setAttribute("style", this.active_style);
    30                if (this.state_hmi) {
    31                this.inactive_elt.setAttribute("style", "display:none");
    31                    this.active_elt.setAttribute("style", this.active_style);
    32            } else {
    32                    this.inactive_elt.setAttribute("style", "display:none");
    33                this.inactive_elt.setAttribute("style", this.inactive_style);
    33                } else {
    34                this.active_elt.setAttribute("style", "display:none");
    34                    this.inactive_elt.setAttribute("style", this.inactive_style);
       
    35                    this.active_elt.setAttribute("style", "display:none");
       
    36                }
    35            }
    37            }
    36         }
    38         }
    37 
    39 
    38         on_click(evt) {
    40         on_click(evt) {
    39             //set state and apply if plc is 0
    41             //set state and apply if plc is 0