|
|
|
@ -28,14 +28,18 @@
|
|
|
|
|
return document.querySelector(modalToggle.hash); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
window.addEventListener('touchend', function (event) { |
|
|
|
|
|
|
|
|
|
var openModal = function (event) { |
|
|
|
|
var modal = getModal(event); |
|
|
|
|
if (modal) { |
|
|
|
|
if (modal && modal.classList.contains('modal')) { |
|
|
|
|
modal.classList.toggle('active'); |
|
|
|
|
} |
|
|
|
|
$(window).trigger("modalOpened", {smth:modal}); |
|
|
|
|
event.preventDefault(); // prevents rewriting url (apps can still use hash values in url)
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}()); |
|
|
|
|
}; |
|
|
|
|
//Added click for desktop compatibility
|
|
|
|
|
window.addEventListener('click', openModal); |
|
|
|
|
window.addEventListener('touchend', openModal); |
|
|
|
|
})(); |
|
|
|
|