move so it doesnt crash

This commit is contained in:
Jacob Levine 2019-03-22 06:53:28 -05:00
parent 4f631a4b79
commit a4288e2a0d

View File

@ -313,6 +313,7 @@ function dec(id) {
function inc(id) {
document.getElementById(id).innerHTML = "<input type='button' onclick=\"dec('" + id + "')\" value='-'></input>" + (parseInt(document.getElementById(id).textContent) + 1).toString() + "<input type='button' onclick=\"inc('" + id + "')\" value='+'></input>"
}
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
@ -341,39 +342,39 @@ function subReport() {
for (var i = 0; i < x.length; i++) {
if (x[i].children[0].tagName == "INPUT") {
push[series + '-' + user.uid][x[i].children[0].id] = x[i].children[0].tagName;
} else if (x[i].children[1].tagName == "TEXTAREA") {
push[series+'-'+user.uid][x[i].children[1].id] = x[i].children[1].innerHTML;
} else if (x[i].children[0].tagName == "SPAN") {
push[series + '-' + user.uid][x[i].children[0].id] = x[i].children[0].innerText;
} else if (x[i].children[0].tagName == "DIV") {
var name = x[i].children[0].id;
push[series + '-' + user.uid][name] = document.querySelector('input[name="' + name + '"]:checked').value;
} else if (x[i].children[1].tagName == "TEXTAREA") {
push[series + '-' + user.uid][x[i].children[1].id] = x[i].children[1].innerHTML;
}
}
var x = document.getElementById('repsec2').children;
for (var i = 0; i < x.length; i++) {
if (x[i].children[0].tagName == "INPUT") {
push[series + '-' + user.uid][x[i].children[0].id] = x[i].children[0].tagName;
} else if (x[i].children[1].tagName == "TEXTAREA") {
push[series+'-'+user.uid][x[i].children[1].id] = x[i].children[1].innerHTML;
} else if (x[i].children[0].tagName == "SPAN") {
push[series + '-' + user.uid][x[i].children[0].id] = x[i].children[0].innerText;
} else if (x[i].children[0].tagName == "DIV") {
var name = x[i].children[0].id;
push[series + '-' + user.uid][name] = document.querySelector('input[name="' + name + '"]:checked').value;
} else if (x[i].children[1].tagName == "TEXTAREA") {
push[series + '-' + user.uid][x[i].children[1].id] = x[i].children[1].innerHTML;
}
}
var x = document.getElementById('repsec3').children;
for (var i = 0; i < x.length; i++) {
if (x[i].children[0].tagName == "INPUT") {
push[series + '-' + user.uid][x[i].children[0].id] = x[i].children[0].tagName;
} else if (x[i].children[1].tagName == "TEXTAREA") {
push[series+'-'+user.uid][x[i].children[1].id] = x[i].children[1].innerHTML;
} else if (x[i].children[0].tagName == "SPAN") {
push[series + '-' + user.uid][x[i].children[0].id] = x[i].children[0].innerText;
} else if (x[i].children[0].tagName == "DIV") {
var name = x[i].children[0].id;
push[series + '-' + user.uid][name] = document.querySelector('input[name="' + name + '"]:checked').value;
} else if (x[i].children[1].tagName == "TEXTAREA") {
push[series + '-' + user.uid][x[i].children[1].id] = x[i].children[1].innerHTML;
}
}
firebase.firestore().collection("data").doc('team-' + document.getElementById('tns').value).collection(currentComp).doc("team-" + teamNum).collection('matches').doc('match-' + matchNum).set(push, {