2022-08-10 21:40:54 +00:00
|
|
|
// var modal = document.querySelector('.modal'); // assuming you have only 1
|
|
|
|
var modal = document.getElementById("drilldown-modal");
|
2022-08-01 17:47:29 +00:00
|
|
|
var html = document.querySelector('html');
|
2022-08-03 06:20:30 +00:00
|
|
|
|
|
|
|
var elements = document.querySelectorAll('.modal-background');
|
|
|
|
for(var i = 0; i < elements.length; i++) {
|
|
|
|
elements[i].addEventListener('click', function(e) {
|
|
|
|
// elements[i].preventDefault();
|
|
|
|
modal.classList.remove('is-active');
|
|
|
|
html.classList.remove('is-clipped');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var elements = document.querySelectorAll('.modal-close');
|
|
|
|
for(var i = 0; i < elements.length; i++) {
|
|
|
|
elements[i].addEventListener('click', function(e) {
|
|
|
|
// elements[i].preventDefault();
|
|
|
|
modal.classList.remove('is-active');
|
|
|
|
html.classList.remove('is-clipped');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function activateButtons() {
|
|
|
|
var elements = document.querySelectorAll('.modal-close-button');
|
|
|
|
for(var i = 0; i < elements.length; i++) {
|
|
|
|
elements[i].addEventListener('click', function(e) {
|
|
|
|
// elements[i].preventDefault();
|
|
|
|
modal.classList.remove('is-active');
|
|
|
|
html.classList.remove('is-clipped');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
activateButtons();
|
|
|
|
// modal.querySelector('.modal-close-button').addEventListener('click', function(e) {
|
|
|
|
// e.preventDefault();
|
|
|
|
// modal.classList.remove('is-active');
|
|
|
|
// html.classList.remove('is-clipped');
|
2022-08-10 21:40:54 +00:00
|
|
|
// });
|