Compare commits
2 Commits
924103a758
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
6b9c0f7d22
|
|||
|
e9c575ab88
|
@@ -45,7 +45,7 @@
|
||||
|
||||
.modal {
|
||||
display: none;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 25%;
|
||||
left: 25%;
|
||||
height: 430px;
|
||||
@@ -243,6 +243,23 @@
|
||||
{{ end }}
|
||||
</main>
|
||||
<script>
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.key === 'Escape') {
|
||||
document.querySelectorAll('.modal.show').forEach(modal => {
|
||||
modal.classList.remove('show');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(event) {
|
||||
const modal = event.target.closest('.modal');
|
||||
if (!modal && document.querySelectorAll('.modal.show').length > 0 && !event.target.closest('.more-link')) {
|
||||
document.querySelectorAll('.modal.show').forEach(modal => {
|
||||
modal.classList.remove('show');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
[...document.querySelectorAll('.more-link')].forEach(more => {
|
||||
const toggleModal = function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user