summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-05-09 01:03:42 -0500
committerstilbruch <stilbruch@protonmail.com>2022-05-09 01:03:42 -0500
commita20ad2dcaad3546d04992676ad1954f7268f3818 (patch)
treeb2c40c5dcb16684f51688a2968cfe0ddc23a1747
parente31a78c3cc4b7691c67b8109d4984a3a857b9fda (diff)
downloadStrengthy-a20ad2dcaad3546d04992676ad1954f7268f3818.tar.xz
Strengthy-a20ad2dcaad3546d04992676ad1954f7268f3818.zip
Fix adding rows for record timers
-rw-r--r--BUGS3
-rw-r--r--app/routes/workout.py1
-rw-r--r--app/static/js/record.js15
-rw-r--r--app/templates/workout/record.html4
4 files changed, 12 insertions, 11 deletions
diff --git a/BUGS b/BUGS
index e69de29..00e613a 100644
--- a/BUGS
+++ b/BUGS
@@ -0,0 +1,3 @@
+/workout/record:
+ First timer is started regardless of which is pushed
+ Timers don't automatically done a row
diff --git a/app/routes/workout.py b/app/routes/workout.py
index 767603e..e27cee8 100644
--- a/app/routes/workout.py
+++ b/app/routes/workout.py
@@ -131,7 +131,6 @@ def workout_record(workout_id=None):
return redirect(url_for("home"))
else:
- print(form.errors)
# Populate form with data
for exercise in workout.exercises:
form.exercises.append_entry(
diff --git a/app/static/js/record.js b/app/static/js/record.js
index a3ea516..2654a47 100644
--- a/app/static/js/record.js
+++ b/app/static/js/record.js
@@ -6,11 +6,10 @@ class Timer {
finish;
}
-// Register 'Enter' listeners on all inputs
-allInputs = Array.from(document.getElementsByClassName('input'))
- .filter(e => e.type == 'number');
-allInputs.forEach(e => e.addEventListener('keydown', handleEnterKey));
-// Register onsubmit handler for form
+// Get an arrayt of all inputs
+allInputs = Array.from(document.getElementsByClassName('input')).filter(e => e.type == 'number');
+
+// Register onsubmit handler for form (NOTE: unfortunatly not a better way to do this)
document.getElementById("form").addEventListener('submit', (el) => {
Array.from(event.target.getElementsByTagName('input')).forEach(i => i.disabled = false);
});
@@ -83,9 +82,9 @@ function setReset(row, index, values=true) {
function setSetid(row, id) {
let setNumber = row.children[0];
- let lbsInput = row.children[1].children[0];
- let repsInput = row.children[2].children[0];
- let doneButton = row.children[3].children[0];
+ //let lbsInput = row.children[1].children[0];
+ //let repsInput = row.children[2].children[0];
+ //let doneButton = row.children[3].children[0];
setNumber.textContent = id + 1;
}
diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html
index c7152cd..3805891 100644
--- a/app/templates/workout/record.html
+++ b/app/templates/workout/record.html
@@ -42,8 +42,8 @@
</div>
</td>
{% else %}
- <td>{{ set['lbs'](class_='input') }}</td>
- <td>{{ set['units'](class_='input') }}</td>
+ <td>{{ set['lbs'](class_='input', onkeydown='handleEnterKey(event)') }}</td>
+ <td>{{ set['units'](class_='input', onkeydown='handleEnterKey(event)') }}</td>
{% endif %}
<td>
<a class="button" onClick="onClickSetCheck(this)">