class DueuiBabyStepPositionWidget extends DueuiPanel { constructor(config, parent){ super($.extend(true, { "skip_population": true, "style": { "display": "flex", "flex-direction": config.direction }, "element_defaults": { "style": {"width": "100%", "font-size": "100%", "margin": "0px", "padding": "0px"}, "status_level": 1, } }, config, {"element_defaults": config.button_defaults}), parent); this.baby = this.baby || []; for (var ix = 0; ix < this.baby.length; ix++) { this.element_configs.push({ "value": this.baby[ix].label + " ${status.coords.xyz["+ this.baby[ix].index+"].toFixed(2).padStart(5)}", "initial_value": `${this.baby[ix].label} 0.0`, "type": "button", "title": this.baby[ix].title || "Home " + this.baby[ix].gcode_axis, "actions": [ {"type": "gcode", "gcode": "M290", "get_reply": true } ] }); } this.populate(); } } DueuiElement.addElementType('babystepposition', DueuiBabyStepPositionWidget);