forked from rDrama/rDrama
1
0
Fork 0

same as last commit

master
Aevann 2023-08-04 19:34:31 +03:00
parent 3165489f58
commit 7007daae9b
1 changed files with 7 additions and 11 deletions

View File

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