svghmi/widget_button.ysl2
branchsvghmi
changeset 2944 2a20038fbea9
child 2961 00825316ed00
equal deleted inserted replaced
2943:304e88bae115 2944:2a20038fbea9
       
     1 // widget_button.ysl2
       
     2 
       
     3 template "widget[@type='Button']", mode="widget_defs" {
       
     4     param "hmi_element";
       
     5     | frequency: 5,
       
     6     | init: function() {
       
     7     |     this.element.addEventListener(
       
     8     |       "mousedown",
       
     9     |       evt => {
       
    10     |           change_hmi_value(this.indexes[0], "=1");
       
    11     |       });
       
    12     |     this.element.addEventListener(
       
    13     |       "mouseup",
       
    14     |       evt => {
       
    15     |           change_hmi_value(this.indexes[0], "=0");
       
    16     |       });
       
    17     | },
       
    18 }