24 foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" { |
24 foreach "$hmi_element/*[regexp:test(@inkscape:label,'^[=+\-].+')]" { |
25 | id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_op_click('«func:escape_quotes(@inkscape:label)»')"); |
25 | id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_op_click('«func:escape_quotes(@inkscape:label)»')"); |
26 } |
26 } |
27 | }, |
27 | }, |
28 | on_op_click: function(opstr) { |
28 | on_op_click: function(opstr) { |
29 | let new_val = change_hmi_value(this.indexes[0], opstr); |
29 | let orig = this.indexes[0]; |
|
30 | let idx = this.offset ? orig - this.offset : orig; |
|
31 | let new_val = change_hmi_value(idx, opstr); |
30 // if "$have_value"{ |
32 // if "$have_value"{ |
31 // | this.value_elt.textContent = String(new_val); |
33 // | this.value_elt.textContent = String(new_val); |
32 // /* TODO gray out value until refreshed */ |
34 // /* TODO gray out value until refreshed */ |
33 // } |
35 // } |
34 | }, |
36 | }, |
35 | on_edit_click: function(opstr) { |
37 | on_edit_click: function(opstr) { |
36 | edit_value("«path/@value»", "«path/@type»", this, this.last_val); |
38 | edit_value("«path/@value»", "«path/@type»", this, this.last_val); |
37 | }, |
39 | }, |
38 |
40 |
39 | edit_callback: function(new_val) { |
41 | edit_callback: function(new_val) { |
40 | apply_hmi_value(this.indexes[0], new_val); |
42 | let orig = this.indexes[0]; |
|
43 | let idx = this.offset ? orig - this.offset : orig; |
|
44 | apply_hmi_value(idx, new_val); |
41 // if "$have_value"{ |
45 // if "$have_value"{ |
42 // | this.value_elt.textContent = String(new_val); |
46 // | this.value_elt.textContent = String(new_val); |
43 // /* TODO gray out value until refreshed */ |
47 // /* TODO gray out value until refreshed */ |
44 // } |
48 // } |
45 | }, |
49 | }, |