We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 245dbdf commit 47e1762Copy full SHA for 47e1762
assets/js/modal.js
@@ -34,6 +34,14 @@ function renderModal () {
34
qs(MODAL_CLOSE_BUTTON_SELECTOR).addEventListener('click', event => {
35
closeModal()
36
})
37
+
38
+ qs(MODAL_SELECTOR).addEventListener('click', event => {
39
+ const classList = event.target.classList
40
+ // if we clicked on the modal overlay/parent but not the modal content
41
+ if (classList.contains('modal') && classList.contains('shown') && classList.length === 2) {
42
+ closeModal()
43
+ }
44
+ })
45
}
46
47
/**
0 commit comments