diff options
| author | FivePixels <o5pxels@gmail.com> | 2022-05-02 18:37:06 -0500 |
|---|---|---|
| committer | FivePixels <o5pxels@gmail.com> | 2022-05-02 18:37:06 -0500 |
| commit | 746d2c2d31f47e3e475c0bf5ffbf2492db78be41 (patch) | |
| tree | 6d9d0bdf6f99962fde5f86af536058821b510797 | |
| parent | 8a8463c20da456f1ed93ba6a57460dd7a19fcefc (diff) | |
| download | Strengthy-746d2c2d31f47e3e475c0bf5ffbf2492db78be41.tar.xz Strengthy-746d2c2d31f47e3e475c0bf5ffbf2492db78be41.zip | |
Fix indentation in record.html, update record.js logic
to add event listener to added sets, fix add sets button, update the
home page href to prevent bug that sent user from /workout/record to
just /workout
| -rw-r--r-- | app/static/js/record.js | 3 | ||||
| -rw-r--r-- | app/templates/base/layout.html | 2 | ||||
| -rw-r--r-- | app/templates/workout/record.html | 24 |
3 files changed, 15 insertions, 14 deletions
diff --git a/app/static/js/record.js b/app/static/js/record.js index 3037c2f..137786e 100644 --- a/app/static/js/record.js +++ b/app/static/js/record.js @@ -87,11 +87,12 @@ function onClickSetCheck(elem) { function onClickAddSet(elem) { // Create the new row - let tableBody = elem.parentElement.parentElement.children[1].children[1]; + let tableBody = elem.parentElement.parentElement.children[2].children[1]; let row = tableBody.children[0].cloneNode(true); // Add new row to table setReset(row); setSetid(row, tableBody.children.length) + row.addEventListener('keydown', handleEnterKey) tableBody.appendChild(row) } diff --git a/app/templates/base/layout.html b/app/templates/base/layout.html index a738cec..afe6143 100644 --- a/app/templates/base/layout.html +++ b/app/templates/base/layout.html @@ -24,7 +24,7 @@ <div class="hero-head"> <nav class="navbar"> <div class="navbar-brand"> - <a class="navbar-item" href="../"> + <a class="navbar-item" href="/"> <img src="/static/favicon/apple-touch-icon.png" alt="Logo"> </a> <span class="navbar-burger burger" data-target="nav-menu"> diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html index aa58ff4..b953a3d 100644 --- a/app/templates/workout/record.html +++ b/app/templates/workout/record.html @@ -16,18 +16,18 @@ </thead> <tbody> {% for set in exercise.sets.entries %} - <tr> - <th>{{ loop.index }}</th> - <td>{{ set['lbs'](class_='input') }}</td> - <td>{{ set['units'](class_='input') }}</td> - <td> - <a class="button" onClick="onClickSetCheck(this)"> - <span class="icon is-small"> - <i class="fa fa-check"></i> - </span> - </a> - </td> - </tr> + <tr> + <th>{{ loop.index }}</th> + <td>{{ set['lbs'](class_='input') }}</td> + <td>{{ set['units'](class_='input') }}</td> + <td> + <a class="button" onClick="onClickSetCheck(this)"> + <span class="icon is-small"> + <i class="fa fa-check"></i> + </span> + </a> + </td> + </tr> {% endfor %} </tbody> </table> |
