summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-05-16 18:26:27 -0500
committerstilbruch <stilbruch@protonmail.com>2022-05-16 18:26:27 -0500
commitf7d6defc6cf8b29dec6321a192cad8eb73dbd4e7 (patch)
treed75789539fdcbf7795ba09761302cca240a0e1f4
parentd2c0dcf06d632389d2c451b1d9d37735291d7e62 (diff)
downloadStrengthy-f7d6defc6cf8b29dec6321a192cad8eb73dbd4e7.tar.xz
Strengthy-f7d6defc6cf8b29dec6321a192cad8eb73dbd4e7.zip
Timers automatically check row when done
-rw-r--r--app/static/js/record.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/static/js/record.js b/app/static/js/record.js
index 2e99766..c8a7810 100644
--- a/app/static/js/record.js
+++ b/app/static/js/record.js
@@ -78,11 +78,17 @@ class Timer {
// Finish timer
finish() {
+ if (this.finished) {
+ return;
+ }
console.log("Finished...");
this.finished = true;
this.pause();
this.setIcon('fa-refresh');
+ this.elem.disabled = true;
+ this.elem.classList.add('is-success')
+ setCheck(this.row);
}
reset() {
@@ -191,11 +197,7 @@ function setCheck(row) {
// TODO: better way to check
if (row.dataset.isTimer) {
const timerButton = row.children[1].children[0].children[0];
- if (timerButton.timer) {
- timerButton.timer.finish();
- }
- timerButton.disabled = true;
- timerButton.classList.add('is-success');
+ Timer.fromElem(timerButton).finish();
} else {
// Disable input editing
row.children[1].firstChild.disabled = true;