Compare commits
2 Commits
924103a758
...
6b9c0f7d22
| Author | SHA1 | Date | |
|---|---|---|---|
|
6b9c0f7d22
|
|||
|
e9c575ab88
|
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
top: 25%;
|
top: 25%;
|
||||||
left: 25%;
|
left: 25%;
|
||||||
height: 430px;
|
height: 430px;
|
||||||
@@ -243,6 +243,23 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</main>
|
</main>
|
||||||
<script>
|
<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 => {
|
[...document.querySelectorAll('.more-link')].forEach(more => {
|
||||||
const toggleModal = function(event) {
|
const toggleModal = function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user