Store iso and fstop as they are set.

This commit is contained in:
mmcwilliams 2018-02-03 16:50:14 -05:00
parent 4b72c9eeed
commit 29485137ca
1 changed files with 11 additions and 27 deletions

View File

@ -203,23 +203,6 @@ var seqState = function (state) {
} }
}; };
var syncInputs = function (selector, cb) {
const elems = document.querySelectorAll(selector);
[].forEach.call(elems, function (input) {
input.oninput = function () {
setInputs(selector, this.value)
cb(this.value)
}
});
};
var setInputs = function (selector, value) {
const elems = document.querySelectorAll(selector);
[].forEach.call(elems, function (input) {
input.value = value;
});
};
var appPage = function () { var appPage = function () {
unsetPages(); unsetPages();
document.getElementById('app').classList.add('selected'); document.getElementById('app').classList.add('selected');
@ -278,19 +261,20 @@ var spinnerHide = function () {
if (elem.classList.contains('active')) { if (elem.classList.contains('active')) {
elem.classList.remove('active'); elem.classList.remove('active');
} }
} };
var isNumeric = function (n) { var isNumeric = function (n) {
return !isNaN(parseFloat(n)) && isFinite(n); return !isNaN(parseFloat(n)) && isFinite(n);
}; };
var init = function () { var init = function () {
syncInputs('.angle', (val) => { document.querySelector('.angle').oninput = function () {
BOLEX.angle = parseInt(val); BOLEX.angle = parseInt(this.value);
}); };
syncInputs('.iso', (val) => { document.querySelector('.iso').oninput = function () {
BOLEX.iso = parseInt(val); BOLEX.iso = parseInt(this.value);
}); };
syncInputs('.fstop', (val) => { document.querySelector('.fstop').oninput = function () {
BOLEX.fstop = parseFloat(val); BOLEX.fstop = parseFloat(this.value);
}); };
}; };