mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-27 01:59:08 +00:00
don't sort matches alphabetically, sort them numerically
This commit is contained in:
parent
169c1737b2
commit
bb5c38fbfe
@ -71,12 +71,19 @@ function changeTeam(teamNum) {
|
||||
if (currentComp != null) {
|
||||
matches = firebase.firestore().collection('appBuilding').doc('team-' + teamNum).collection('competitions').doc(currentComp).collection('scoutsAndSchedule');
|
||||
matches.get().then(function(qs) {
|
||||
var oklist = []
|
||||
qs.forEach(function(dc) {
|
||||
//regex search!
|
||||
var pattern = /\d+/;
|
||||
var name = dc.id;
|
||||
document.getElementById('mselect').innerHTML += "<option value='" + name.match(pattern)[0].toString() + "'>" + name.match(pattern)[0].toString() + "</option>";
|
||||
oklist.push(name.match(pattern)[0].toString())
|
||||
});
|
||||
oklist.sort(function(a, b) {
|
||||
return parseInt(a) - parseInt(b)
|
||||
})
|
||||
for (var i = 0; i < oklist.length; i++) {
|
||||
document.getElementById('mselect').innerHTML += "<option value='" + oklist[i] + "'>" + oklist[i] + "</option>";
|
||||
}
|
||||
cmatch(document.getElementById('mselect').value);
|
||||
});
|
||||
}
|
||||
@ -313,6 +320,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);
|
||||
}
|
||||
@ -381,7 +389,7 @@ function subReport() {
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
firebase.firestore().collection('webData').doc('test').set(push).then(function() {
|
||||
firebase.firestore().collection("data").doc('team-' + document.getElementById('tns').value).collection(currentComp).doc("team-" + teamNum).collection('matches').doc('match-' + matchNum).set(function() {
|
||||
alert('Submitted!')
|
||||
setTimeout(function() {
|
||||
window.location.href = '../scout';
|
||||
|
Loading…
Reference in New Issue
Block a user