diff options
| -rw-r--r-- | BUGS | 3 | ||||
| -rw-r--r-- | app/routes/workout.py | 1 | ||||
| -rw-r--r-- | app/static/js/record.js | 15 | ||||
| -rw-r--r-- | app/templates/workout/record.html | 4 |
4 files changed, 12 insertions, 11 deletions
@@ -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)"> |
