Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 9 additions and 2 deletions
Showing only changes of commit 550dad4c91 - Show all commits

View File

@ -410,7 +410,7 @@
} }
}; };
web.setDir = function () { web.setDir = function () {
const dir = !document.getElementById('dir').checked; const dir = document.getElementById('dir').checked;
/*$.ajax({ /*$.ajax({
method : 'POST', method : 'POST',
url : '/dir', url : '/dir',
@ -423,7 +423,14 @@
method : 'POST', method : 'POST',
body : { dir : dir} body : { dir : dir}
}; };
fetch('/dir', opts).then(web.setDirSuccess); fetch('/dir', opts)
.then(res => {
return res.json()
})
.then(web.setDirSuccess).catch(err => {
console.error('Error setting direction')
console.error(err);
});
}; };
web.setDirSuccess = function (res) { web.setDirSuccess = function (res) {
STATE.dir = res.dir; STATE.dir = res.dir;