We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5677e11 commit 21d89e9Copy full SHA for 21d89e9
docs/js/Modal.js
@@ -18,7 +18,15 @@
18
event.preventDefault();
19
const modal = document.getElementById(event.currentTarget.dataset.target);
20
if (!modal) return;
21
- modal && (modal.open ? closeModal(modal) : openModal(modal));
+ if(event.currentTarget.dataset.close) {
22
+ const modalClose = document.getElementById(event.currentTarget.dataset.close);
23
+ if(modalClose){
24
+ closeModal(modalClose);
25
+ setTimeout(() => modal && (modal.open ? closeModal(modal) : openModal(modal)), animationDuration);
26
+ }
27
+ } else {
28
+ modal && (modal.open ? closeModal(modal) : openModal(modal));
29
30
};
31
32
// Open modal
0 commit comments