From 746d2c2d31f47e3e475c0bf5ffbf2492db78be41 Mon Sep 17 00:00:00 2001 From: FivePixels Date: Mon, 2 May 2022 18:37:06 -0500 Subject: 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 --- app/static/js/record.js | 3 ++- app/templates/base/layout.html | 2 +- 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 @@