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

slider sends (browser dependent) lots of events, throttle using only unique values.

This commit is contained in:
tecteun 2021-02-05 22:03:02 +00:00
parent 8cdedaf3cb
commit 9ab8a84ff0
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;
}
var sliderCache = {};
function sliderchange(number) {
var val = $("#sl" + number).val();
websock.send("slvalue:" + val + ":" + number);
sliderCache[number] !== val && websock.send("slvalue:" + val + ":" + number);
sliderCache[number] = val;
}
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