1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-11-21 22:50:55 +00:00

Realign with upstream

This commit is contained in:
Ian Gray 2022-01-03 15:39:48 +00:00
parent 0ab401c3b1
commit 7e5331d54f

View File

@ -1035,17 +1035,21 @@ Control* ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, Control* con
if (control->elementStyle != 0)
item["elementStyle"] = String(control->elementStyle);
if (control->parentControl != Control::noParent) {
if (control->parentControl != Control::noParent)
{
item["parentControl"] = String(control->parentControl);
}
// special case for selects: to preselect an option, you have to add
// "selected" to <option>
if (control->type == ControlType::Option) {
if (ESPUI.getControl(control->parentControl)->value == control->value) {
if (control->type == ControlType::Option)
{
if (ESPUI.getControl(control->parentControl)->value == control->value)
{
item["selected"] = "selected";
}
else {
else
{
item["selected"] = "";
}
}