diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/static/js/record.js | 12 |
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; |
