svghmi/widget_tooglebutton.ysl2
branchsvghmi
changeset 3232 7bdb766c2a4d
parent 3219 cc0ecc5e918f
child 3241 fe945f1f48b7
--- a/svghmi/widget_tooglebutton.ysl2	Thu Apr 15 09:15:23 2021 +0200
+++ b/svghmi/widget_tooglebutton.ysl2	Sun May 02 23:01:08 2021 +0200
@@ -1,9 +1,8 @@
 // widget_tooglebutton.ysl2
 
 
-template "widget[@type='ToggleButton']", mode="widget_class"{
+widget_class("ToggleButton") {
     ||
-    class ToggleButtonWidget extends Widget{
         frequency = 5;
         state = 0;
         active_style = undefined;
@@ -41,11 +40,10 @@
             this.activate(false);
             this.element.onclick = (evt) => this.on_click(evt);
         }
-    }
     ||
 }
 
-template "widget[@type='ToggleButton']", mode="widget_defs" {
+widget_defs("ToggleButton") {
     param "hmi_element";
     optional_labels("active inactive");
 }