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 |
|
6 /* check that given path is compatible with page's reference path */ |
|
7 if "count(arg) > 0 and count(path) > 0" { |
|
8 const "target_page_name", "arg[1]/@value"; |
|
9 const "target_page_desc", "$hmi_pages_descs[arg[1]/@value = $target_page_name]"; |
|
10 const "target_page_path", "$target_page_desc/path[1]/@value"; |
|
11 if "not(func:same_class_paths($target_page_path, path[1]/@value))" |
|
12 warning > Jump id="«@id»" to page "«$target_page_name»" with incompatible path "«path[1]/@value»" |
|
13 } |
|
14 /* TODO check that path is also matching in case of implicit local jump (no page name given) */ |
|
15 |
5 | on_click: function(evt) { |
16 | on_click: function(evt) { |
6 | const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined; |
17 | const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined; |
7 | switch_page(this.args[0], index); |
18 | switch_page(this.args[0], index); |
8 | }, |
19 | }, |
9 | init: function() { |
20 | init: function() { |