From fca07d03711432349331e0ae6f6905cf0db0ff15 Mon Sep 17 00:00:00 2001 From: nalbam Date: Fri, 8 Nov 2019 16:16:19 +0900 Subject: [PATCH] console.log --- static/timer.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/static/timer.js b/static/timer.js index a64049a..f5c5f5b 100644 --- a/static/timer.js +++ b/static/timer.js @@ -139,6 +139,8 @@ class Timer { li.innerText = this.format(this.times); this.results.appendChild(li); + console.log(this.format(this.times)); + this.latest = this.times; this.records.push(this.times); this.records.sort(compare); @@ -146,15 +148,28 @@ class Timer { } remove() { + if (this.records.length == 0) { + return; + } + + console.log(this.format(this.records[0])); + this.latest = null; this.records.splice(0, 1); - this.bestlap.innerText = this.format(this.records[0]); + if (this.records.length == 0) { + this.bestlap.innerText = ""; + } else { + this.bestlap.innerText = this.format(this.records[0]); + } } squeeze() { if (!this.latest) { return; } + + console.log(this.format(this.latest)); + this.times[2] += this.latest[2]; this.times[1] += this.latest[1]; this.times[0] += this.latest[0];