limiting the #modal shit to mobile only

pull/139/head
Aevann 2023-03-12 10:34:33 +02:00
parent 0f62958024
commit 2953a918bd
1 changed files with 19 additions and 16 deletions

View File

@ -584,21 +584,24 @@ function handleUploadProgress(e, upload_prog) {
}
}
document.getElementById('expandImageModal').addEventListener('show.bs.modal', function () {
setTimeout(() => {
location.hash = "modal";
}, 200);
});
document.getElementById('expandImageModal').addEventListener('hide.bs.modal', function () {
if(location.hash == "#modal") {
history.back();
}
});
if (width <= 768) {
document.getElementById('expandImageModal').addEventListener('show.bs.modal', function () {
setTimeout(() => {
location.hash = "modal";
}, 200);
});
window.addEventListener('hashchange', function () {
if(location.hash != "#modal") {
const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0])
if (curr_modal) curr_modal.hide()
}
});
document.getElementById('expandImageModal').addEventListener('hide.bs.modal', function () {
if(location.hash == "#modal") {
history.back();
}
});
window.addEventListener('hashchange', function () {
if(location.hash != "#modal") {
const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0])
if (curr_modal) curr_modal.hide()
}
});
}