diff -r cb7db021280c -r d6c9da8d594e svghmi/widget_input.ysl2 --- a/svghmi/widget_input.ysl2 Mon Jul 11 22:21:20 2022 +0200 +++ b/svghmi/widget_input.ysl2 Mon Jul 11 23:18:14 2022 +0200 @@ -65,6 +65,8 @@ const "have_edit","string-length($edit_elt)>0"; value "$edit_elt"; + const "action_elements", "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]"; + if "$have_value" | frequency: 5, | dispatch: function(value) { @@ -94,6 +96,9 @@ | }, } + foreach "$action_elements" { + | action_elt_«position()»: id("«@id»"), + } | init: function() { if "$have_edit" { @@ -104,8 +109,8 @@ | this.animate(); } - foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" { - | id("«@id»").onclick = () => this.on_op_click("«func:escape_quotes(@inkscape:label)»"); + foreach "$action_elements" { + | this.action_elt_«position()».onclick = () => this.on_op_click("«func:escape_quotes(@inkscape:label)»"); } if "$have_value" {