forked from rDrama/rDrama
1
0
Fork 0

restore #modal

master
Aevann 2023-07-30 10:22:33 +03:00
parent 5e0bd47da0
commit 9e24ea9c6f
1 changed files with 20 additions and 0 deletions

View File

@ -584,6 +584,26 @@ function handleUploadProgress(e, upload_prog) {
}
}
if (screen_width <= 768) {
document.addEventListener('shown.bs.modal', () => {
location.hash = "modal";
});
document.addEventListener('hidden.bs.modal', () => {
if(location.hash == "#modal") {
history.back();
}
});
window.addEventListener('hashchange', () => {
if(location.hash != "#modal") {
const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0])
if (curr_modal) curr_modal.hide()
}
});
}
document.querySelectorAll('form').forEach(form => {
form.addEventListener('submit', (e) => {
if (form.classList.contains('is-submitting')) {