From aaea0fb87730fa9febc205f46e26202e27e3d8be Mon Sep 17 00:00:00 2001 From: Ian Gray Date: Wed, 29 Dec 2021 17:52:03 +0000 Subject: [PATCH] Fixes #122 --- data/js/controls.js | 5 +++++ data/js/controls.min.js | 3 ++- src/dataControlsJS.h | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/data/js/controls.js b/data/js/controls.js index e93f2f4..4ed3bf2 100644 --- a/data/js/controls.js +++ b/data/js/controls.js @@ -817,6 +817,11 @@ function start() { element.addClass(colorClass(data.color)); } } + + $(".range-slider__range").each(function(){ + $(this)[0].value = $(this).attr("value"); + $(this).next().html($(this).attr("value")); + }); }; websock.onmessage = handleEvent; diff --git a/data/js/controls.min.js b/data/js/controls.min.js index a799fad..80de178 100644 --- a/data/js/controls.min.js +++ b/data/js/controls.min.js @@ -250,7 +250,8 @@ data.id+ "'>"+ "");requestOrientationPermission();} break;case UPDATE_LABEL:$("#l"+data.id).html(data.value);break;case UPDATE_SWITCHER:switcher(data.id,data.value=="0"?0:1);break;case UPDATE_SLIDER:slider_move($("#id"+data.id),data.value,"100",false);break;case UPDATE_NUMBER:$("#num"+data.id).val(data.value);break;case UPDATE_TEXT_INPUT:$("#text"+data.id).val(data.value);break;case UPDATE_SELECT:$("#select"+data.id).val(data.value);break;case UPDATE_BUTTON:case UPDATE_PAD:case UPDATE_CPAD:break;case UPDATE_GAUGE:$("#gauge"+data.id).val(data.value);break;case UPDATE_ACCEL:break;default:console.error("Unknown type or event");break;} -if(data.type>=UPDATE_OFFSET&&data.type=UPDATE_OFFSET&&data.type"+ "");requestOrientationPermission();} break;case UPDATE_LABEL:$("#l"+data.id).html(data.value);break;case UPDATE_SWITCHER:switcher(data.id,data.value=="0"?0:1);break;case UPDATE_SLIDER:slider_move($("#id"+data.id),data.value,"100",false);break;case UPDATE_NUMBER:$("#num"+data.id).val(data.value);break;case UPDATE_TEXT_INPUT:$("#text"+data.id).val(data.value);break;case UPDATE_SELECT:$("#select"+data.id).val(data.value);break;case UPDATE_BUTTON:case UPDATE_PAD:case UPDATE_CPAD:break;case UPDATE_GAUGE:$("#gauge"+data.id).val(data.value);break;case UPDATE_ACCEL:break;default:console.error("Unknown type or event");break;} -if(data.type>=UPDATE_OFFSET&&data.type=UPDATE_OFFSET&&data.type