Skip to content

Commit

Permalink
Also handle new profile cancel on another cross close button
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Jul 2, 2021
1 parent 3e266cb commit aabd977
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions extension/src/sites/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="new-profile-label">Create a new profile</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close" id="new-profile-cancel1" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
Expand All @@ -77,7 +77,7 @@ <h5 class="modal-title" id="new-profile-label">Create a new profile</h5>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" id="new-profile-cancel" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-secondary" id="new-profile-cancel2" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="new-profile-create">Create</button>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions extension/src/sites/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ async function initializeForm () {
event.preventDefault()
})

document.getElementById('new-profile-cancel').addEventListener('click', function () {
profilesElement.value = lastProfileSelection
})
const newProfileOnCancel = function () { profilesElement.value = lastProfileSelection }
document.getElementById('new-profile-cancel1').addEventListener('click', newProfileOnCancel)
document.getElementById('new-profile-cancel2').addEventListener('click', newProfileOnCancel)

document.getElementById('new-profile-create').addEventListener('click', async function () {
const name = document.getElementById('new-profile-name').value || null
Expand Down

0 comments on commit aabd977

Please sign in to comment.