fix(docs): закрытие модалки картинки по клику на оверлей
This commit is contained in:
@@ -528,6 +528,17 @@ function showImg(src) {
|
||||
if (img && m) { img.src = src; m.classList.add('open'); }
|
||||
}
|
||||
|
||||
const imgModalEl = document.getElementById('imgModal');
|
||||
if (imgModalEl) {
|
||||
imgModalEl.addEventListener('click', e => {
|
||||
if (e.target === imgModalEl) {
|
||||
imgModalEl.classList.remove('open');
|
||||
const srcEl = document.getElementById('imgModalSrc');
|
||||
if (srcEl) srcEl.removeAttribute('src');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function fillAutocomplete() {
|
||||
const res = await fetch(`${API}/api/students`, { headers: hdr() });
|
||||
const students = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user