Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions assets/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ function renderModal () {
qs(MODAL_CLOSE_BUTTON_SELECTOR).addEventListener('click', event => {
closeModal()
})

qs(MODAL_SELECTOR).addEventListener('click', event => {
const classList = event.target.classList
// if we clicked on the modal overlay/parent but not the modal content
if (classList.contains('modal') && classList.contains('shown') && classList.length === 2) {
closeModal()
}
})

}

/**
Expand Down