Push dev work to master #2
|
@ -174,9 +174,25 @@ var setState = function (res) {
|
||||||
if (res.sequence == true) {
|
if (res.sequence == true) {
|
||||||
STATE.sequence = true;
|
STATE.sequence = true;
|
||||||
mobile.ble.active = true;
|
mobile.ble.active = true;
|
||||||
document.getElementById('seq').classList.add('focus');
|
seqState(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var seqState = function (state) {
|
||||||
|
const elem = document.getElementById('seq')
|
||||||
|
if (state) {
|
||||||
|
if (!elem.classList.contains('focus')) {
|
||||||
|
elem.classList.add('focus');
|
||||||
|
elem.innerText = 'STOP SEQUENCE';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (elem.classList.contains('focus')) {
|
||||||
|
elem.classList.remove('focus');
|
||||||
|
elem.innerText = 'START SEQUENCE';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var appPage = function () {
|
var appPage = function () {
|
||||||
unsetPages();
|
unsetPages();
|
||||||
document.getElementById('app').classList.add('selected');
|
document.getElementById('app').classList.add('selected');
|
||||||
|
|
|
@ -152,14 +152,11 @@ web.sequenceSuccess = function (res) {
|
||||||
if (res.started && res.started != false) {
|
if (res.started && res.started != false) {
|
||||||
STATE.sequence = true;
|
STATE.sequence = true;
|
||||||
document.getElementById('seq').focus();
|
document.getElementById('seq').focus();
|
||||||
if (!document.getElementById('seq').classList.contains('focus')) {
|
seqState(true);
|
||||||
document.getElementById('seq').classList.add('focus');
|
|
||||||
}
|
|
||||||
} else if (res.stopped) {
|
} else if (res.stopped) {
|
||||||
STATE.sequence = false;
|
STATE.sequence = false;
|
||||||
document.getElementById('seq').blur();
|
document.getElementById('seq').blur();
|
||||||
document.getElementById('seq').classList.remove('focus');
|
seqState(false);
|
||||||
//update frontend at end of sequence
|
|
||||||
mobile.getState();
|
mobile.getState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue