Skip to content

Commit

Permalink
feat(angles-preview): add a reset button to go to the previous page w…
Browse files Browse the repository at this point in the history
…ithout saving when not required
  • Loading branch information
FlorentinTh committed Sep 14, 2023
1 parent 23918d4 commit 69622f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scripts/angles-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const analysisType = PathHelper.sanitizePath(
const analysisTitle = document.querySelector('.analysis h3');
const gridContainer = document.querySelector('.participant-card-container');
const submitButton = document.querySelector('button[type="submit"]');
const resetButton = document.querySelector('button[type="reset"]');

analysisTitle.innerText += ` ${analysisType}`;

Expand Down Expand Up @@ -393,3 +394,7 @@ submitButton.addEventListener('click', async () => {
}
}
});

resetButton.addEventListener('click', event => {
router.switchPage('participants-selection');
});
5 changes: 5 additions & 0 deletions src/views/angles-preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ <h3>Type of Analysis:</h3>
<button type="submit">Save</button>
</div>
</div>
<div class="group">
<div class="button-container">
<button type="reset">Cancel</button>
</div>
</div>
</section>
</main>
</div>
Expand Down

0 comments on commit 69622f4

Please sign in to comment.