mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-24 02:10:55 +00:00
Merge pull request #97 from ericBcreator/add_tab_callback_function
Add tab callback function
This commit is contained in:
commit
34d974b03b
7
data/js/controls.js
vendored
7
data/js/controls.js
vendored
@ -557,7 +557,7 @@ function start() {
|
||||
|
||||
case UI_TAB:
|
||||
$("#tabsnav").append(
|
||||
"<li><a href='#tab" + data.id + "'>" + data.value + "</a></li>"
|
||||
"<li><a onmouseup='tabclick(" + data.id + ")' href='#tab" + data.id + "'>" + data.value + "</a></li>"
|
||||
);
|
||||
$("#tabscontent").append("<div id='tab" + data.id + "'></div>");
|
||||
|
||||
@ -814,6 +814,11 @@ function textchange(number) {
|
||||
websock.send("tvalue:" + val + ":" + number);
|
||||
}
|
||||
|
||||
function tabclick(number) {
|
||||
var val = $("#tab" + number).val();
|
||||
websock.send("tabvalue:" + val + ":" + number);
|
||||
}
|
||||
|
||||
function selectchange(number) {
|
||||
var val = $("#select" + number).val();
|
||||
websock.send("svalue:" + val + ":" + number);
|
||||
|
250
data/js/controls.min.js
vendored
250
data/js/controls.min.js
vendored
File diff suppressed because one or more lines are too long
@ -541,6 +541,10 @@ void onWsEvent(
|
||||
ESPUI.updateControl(c, client->id());
|
||||
c->callback(c, T_VALUE);
|
||||
}
|
||||
else if (msg.startsWith("tabvalue:"))
|
||||
{
|
||||
c->callback(c, client->id());
|
||||
}
|
||||
else if (msg.startsWith(F("svalue:")))
|
||||
{
|
||||
c->value = msg.substring(msg.indexOf(':') + 1, msg.lastIndexOf(':'));
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user