equal
deleted
inserted
replaced
1 // widget_button.ysl2 |
1 // widget_button.ysl2 |
2 |
2 |
3 template "widget[@type='Button']", mode="widget_defs" { |
3 template "widget[@type='Button']", mode="widget_class" |
4 param "hmi_element"; |
4 || |
5 | frequency: 5, |
5 class ButtonWidget extends Widget{ |
6 | init: function() { |
6 frequency = 5; |
7 | this.element.addEventListener( |
7 init() { |
8 | "mousedown", |
8 this.element.addEventListener( |
9 | evt => { |
9 "mousedown", |
10 | change_hmi_value(this.indexes[0], "=1"); |
10 evt => { |
11 | }); |
11 change_hmi_value(this.indexes[0], "=1"); |
12 | this.element.addEventListener( |
12 }); |
13 | "mouseup", |
13 this.element.addEventListener( |
14 | evt => { |
14 "mouseup", |
15 | change_hmi_value(this.indexes[0], "=0"); |
15 evt => { |
16 | }); |
16 change_hmi_value(this.indexes[0], "=0"); |
17 | }, |
17 }); |
18 } |
18 } |
|
19 } |
|
20 || |