--- a/svghmi/widget_input.ysl2 Wed Apr 01 14:42:50 2020 +0200
+++ b/svghmi/widget_input.ysl2 Thu Apr 02 09:38:53 2020 +0200
@@ -24,14 +24,14 @@
| evt => alert('XXX TODO : Edit value'));
foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" {
- | id("«@id»").addEventListener(
- | evt => {let new_val = change_hmi_value(this.indexes[0], "«func:escape_quotes(@inkscape:label)»");
- | this.value_elt.textContent = String(new_val);
- /* TODO gray out value until refreshed */
+ | id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_op_click('«func:escape_quotes(@inkscape:label)»')"); + | on_op_click: function(opstr) { + | let new_val = change_hmi_value(this.indexes[0], opstr); + | this.value_elt.textContent = String(new_val); + /* TODO gray out value until refreshed */