beremiz
Clone
Summary
Browse
Changes
Graph
SVGHMI: Switch widget was picking sub-elements from original SVG, not the result SVG ehwe clones are unlinked, thus making problems with svg:use based widgets.
svghmi
2020-05-14, Edouard Tisserant
88988edb2e93
SVGHMI: Switch widget was picking sub-elements from original SVG, not the result SVG ehwe clones are unlinked, thus making problems with svg:use based widgets.
// widget_button.ysl2
template "widget[@type='Button']", mode="widget_class"
||
class ButtonWidget extends Widget{
frequency = 5;
init() {
this.element.addEventListener(
"mousedown",
evt => {
change_hmi_value(this.indexes[0], "=1");
});
this.element.addEventListener(
"mouseup",
evt => {
change_hmi_value(this.indexes[0], "=0");
});
}
}
||