equal
deleted
inserted
replaced
1 // widget_jump.ysl2 |
1 // widget_jump.ysl2 |
2 |
2 |
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 | on_click: function(evt) { |
5 | on_click: function(evt) { |
6 | switch_page(this.args[0], this.indexes[0]); |
6 | const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined; |
|
7 | switch_page(this.args[0], index); |
7 | }, |
8 | }, |
8 | init: function() { |
9 | init: function() { |
9 /* registering event this way doies not "click" through svg:use |
10 /* registering event this way doies not "click" through svg:use |
10 | this.element.onclick = evt => switch_page(this.args[0]); |
11 | this.element.onclick = evt => switch_page(this.args[0]); |
11 event must be registered by adding attribute to element instead |
12 event must be registered by adding attribute to element instead |