mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-24 07:20:53 +00:00
Fixes #136 and also severe bug in addControl
This commit is contained in:
parent
eebefd915c
commit
1df56772d9
@ -590,7 +590,7 @@ void onWsEvent(
|
||||
uint16_t ESPUIClass::addControl(ControlType type, const char* label, const String& value, ControlColor color,
|
||||
uint16_t parentControl, void (*callback)(Control*, int))
|
||||
{
|
||||
Control* control = new Control(type, label, callback, value, color, parentControl);
|
||||
Control* control = new Control(type, label, callback, value, color, true, parentControl);
|
||||
|
||||
if (this->controls == nullptr)
|
||||
{
|
||||
@ -969,6 +969,7 @@ void ESPUIClass::jsonDom(AsyncWebSocketClient* client)
|
||||
item["label"] = control->label;
|
||||
item["value"] = String(control->value);
|
||||
item["color"] = (int)control->color;
|
||||
item["visible"] = control->visible;
|
||||
|
||||
if (control->parentControl != Control::noParent)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user