forked from rDrama/rDrama
1
0
Fork 0

same as last commit

master
Aevann 2023-08-03 13:52:20 +03:00
parent 7051699ffb
commit 34ac1dec27
1 changed files with 8 additions and 8 deletions

View File

@ -586,18 +586,18 @@ function handleUploadProgress(e, upload_prog) {
if (screen_width <= 768) {
document.addEventListener('shown.bs.modal', (e) => {
location.hash = `m-${e.target.id}`;
addEventListener('show.bs.modal', function () {
location.hash = "modal";
});
document.addEventListener('hidden.bs.modal', (e) => {
if (location.hash == `#m-${e.target.id}`) {
addEventListener('hide.bs.modal', function () {
if(location.hash == "#modal") {
history.back();
}
});
window.addEventListener('hashchange', () => {
if (!location.hash.startsWith("#m-")) {
addEventListener('hashchange', function () {
if(location.hash != "#modal") {
const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0])
if (curr_modal) curr_modal.hide()
}