Skip to content
Snippets Groups Projects
Commit 393bda60 authored by AA2875's avatar AA2875
Browse files

Kokonais vapaapudotusaika poistettu

parent df37ace2
No related branches found
No related tags found
No related merge requests found
function init() {
let infoText = document.getElementById('infoText')
infoText.innerHTML = 'Ladataan hyppyjä palvelimelta, odota...'
jumpOrder = 'desc'
jumpOrder = 'asc'
loadJumps()
// Send form with enter
......@@ -64,15 +64,15 @@ function createJumpListItem(jump) {
}
return li
}
var totalFalltime = 0
function jumpItemFullInfo(jump) {
totalFalltime += parseInt(jump.falltime)
const specs = [
'Paikka: ' + jump.place,
'Lentokone: ' + jump.plane,
'Päävarjo: ' + jump.canopy,
'Korkeus: ' + jump.height + ' m',
'Vapaapudotusaika: ' + jump.falltime + ' s ' + `(yht. ${totalFalltime} s)`,
'Vapaapudotusaika: ' + jump.falltime + ' s',
jump.comments,
jump.link
]
......@@ -162,7 +162,7 @@ function showJumps(jumps) {
if (jumps.length === 0) {
infoText.innerHTML = 'Ei hyppyjä'
} else {
if (jumpOrder == 'desc') {
if (jumpOrder == 'asc') {
jumps.sort((a, b) => a.number - b.number)
} else {
jumps.sort((a, b) => b.number - a.number)
......@@ -176,15 +176,16 @@ function showJumps(jumps) {
}
function changeJumpOrder() {
document.getElementById('jumpsList').innerHTML = ''
let button = document.getElementById('sortJumpsButton')
if (button.innerHTML == 'Järjestys ▼') {
button.innerHTML = 'Järjestys ▲'
jumpOrder = 'desc'
jumpOrder = 'asc'
showJumps(jumpsJSON)
} else {
button.innerHTML = 'Järjestys ▼'
jumpOrder = 'asc'
jumpOrder = 'desc'
showJumps(jumpsJSON)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment