Commit 683ee39e authored by pumpkin's avatar pumpkin

Set badge value when load patch from circuit.

parent 5b393551
......@@ -157,9 +157,13 @@ function parseCircuitPatch(circuitData) {
if (item) {
item.value = synthValuesArr[i];
}
synthHistoryAdd(item.id, item.value);
synthHistoryAdd(item.id, item.value);
if (item.type == 'range') {
setBadgeValue(item, item.value);
}
}
}
}
......@@ -225,6 +229,10 @@ function sendMessage(control, value) {
}
function setBadgeValue(inputRange, value) {
if (inputRange.disabled) {
return;
}
if (inputRange.getAttribute("zero")) {
value = value - inputRange.getAttribute("zero");
}
......@@ -232,7 +240,7 @@ function setBadgeValue(inputRange, value) {
try {
inputRange.previousElementSibling.previousElementSibling.innerText = value;
} catch(err) {
console.log(err);
console.log(err, inputRange, value);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment