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

Merge pull request #114 from tecteun/master

slider sends (browser dependent) lots of events, throttle using only …
This commit is contained in:
Lukas Bachschwell 2021-02-06 09:41:26 +01:00 committed by GitHub
commit 48826caee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 504 additions and 4 deletions

4
data/js/controls.js vendored
View File

@ -799,9 +799,11 @@ function start() {
websock.onmessage = handleEvent; websock.onmessage = handleEvent;
} }
var sliderCache = {};
function sliderchange(number) { function sliderchange(number) {
var val = $("#sl" + number).val(); var val = $("#sl" + number).val();
websock.send("slvalue:" + val + ":" + number); sliderCache[number] !== val && websock.send("slvalue:" + val + ":" + number);
sliderCache[number] = val;
} }
function numberchange(number) { function numberchange(number) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long