Set innerHTML of non-input elements, not value. This is why labels are not changing.

This commit is contained in:
mmcw-dev 2017-12-23 22:30:17 -05:00
parent f044c0eee3
commit 727ec7cae0
3 changed files with 10 additions and 7 deletions

View File

@ -52,7 +52,7 @@
<button id="seq" onclick="sequence();">START SEQUENCE</button> <button id="seq" onclick="sequence();">START SEQUENCE</button>
</div> </div>
<div> <div>
<button id="frame" onclick="frame();">1 FRAME</button> <button id="frame" onclick="frame();">+1 FRAME</button>
</div> </div>
</div> </div>
<div id="settings" class="page"> <div id="settings" class="page">

View File

@ -113,12 +113,15 @@ var setDelayScale = function () {
var setDirLabel = function (dir) { var setDirLabel = function (dir) {
const bwdLabel = document.getElementById('bwdLabel'); const bwdLabel = document.getElementById('bwdLabel');
const fwdLabel = document.getElementById('fwdLabel'); const fwdLabel = document.getElementById('fwdLabel');
const but = document.getElementById('frame');
if (dir) { if (dir) {
bwdLabel.classList.remove('selected') bwdLabel.classList.remove('selected');
fwdLabel.classList.add('selected') fwdLabel.classList.add('selected');
frame.innerHTML = '+1 FRAME';
} else { } else {
fwdLabel.classList.remove('selected') fwdLabel.classList.remove('selected');
bwdLabel.classList.add('selected') bwdLabel.classList.add('selected');
frame.innerHTML = '-1 FRAME';
} }
}; };
var incCounter = function (val) { var incCounter = function (val) {
@ -162,7 +165,7 @@ var setState = function (res) {
exposure = shutter(STATE.exposure); exposure = shutter(STATE.exposure);
exposureScale = scaleAuto(STATE.exposure); exposureScale = scaleAuto(STATE.exposure);
document.getElementById('str').value = exposure.str; document.getElementById('str').innerHTML = exposure.str;
document.getElementById('scale').value = exposureScale; document.getElementById('scale').value = exposureScale;
setExposureScale(); setExposureScale();

View File

@ -89,7 +89,7 @@ web.setExposureSuccess = function (res) {
} }
STATE.exposure = res.exposure; STATE.exposure = res.exposure;
exposure = shutter(STATE.exposure); exposure = shutter(STATE.exposure);
document.getElementById('str').value = exposure.str; document.getElementById('str').innerHTML = exposure.str;
console.log(`setExposure to ${res.exposure}`); console.log(`setExposure to ${res.exposure}`);
}; };
web.setDelay = function () { web.setDelay = function () {