equal
deleted
inserted
replaced
3 template "widget[@type='Jump']", mode="widget_defs" { |
3 template "widget[@type='Jump']", mode="widget_defs" { |
4 param "hmi_element"; |
4 param "hmi_element"; |
5 |
5 |
6 | on_click: function(evt) { |
6 | on_click: function(evt) { |
7 | const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined; |
7 | const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined; |
8 | switch_page(this.args[0], index); |
8 | const name = this.args[0]; |
|
9 | switch_page(name, index); |
9 | }, |
10 | }, |
10 | init: function() { |
11 | init: function() { |
11 /* registering event this way does not "click" through svg:use |
12 /* registering event this way does not "click" through svg:use |
12 | this.element.onclick = evt => switch_page(this.args[0]); |
13 | this.element.onclick = evt => switch_page(this.args[0]); |
13 event must be registered by adding attribute to element instead |
14 event must be registered by adding attribute to element instead |