mirror of
https://github.com/s00500/ESPUI.git
synced 2025-06-14 02:30:41 +00:00
Dynamic visibility support
The ability to make controls visible and invisible was basically already supported, we just need to add some minor handling in controls.js.
This commit is contained in:
@ -910,6 +910,15 @@ void ESPUIClass::updateControlValue(uint16_t id, const String& value, int client
|
||||
updateControlValue(control, value, clientId);
|
||||
}
|
||||
|
||||
void ESPUIClass::updateVisibility(uint16_t id, bool visibility, int clientId) {
|
||||
Control* control = getControl(id);
|
||||
if(control)
|
||||
{
|
||||
control->visible = visibility;
|
||||
updateControl(id);
|
||||
}
|
||||
}
|
||||
|
||||
void ESPUIClass::print(uint16_t id, const String& value)
|
||||
{
|
||||
updateControlValue(id, value);
|
||||
|
@ -301,6 +301,7 @@ public:
|
||||
|
||||
void setPanelWide(uint16_t id, bool wide);
|
||||
void setVertical(uint16_t id, bool vert = true);
|
||||
void updateVisibility(uint16_t id, bool visibility, int clientId = -1);
|
||||
|
||||
// Variables
|
||||
const char* ui_title = "ESPUI"; // Store UI Title and Header Name
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user