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
if (object) {
object.addEventListener('hide.bs.modal', function () {
if(location.hash == "#modal") {
object.addEventListener('shown.bs.modal', function (e) {
location.hash = `m-${e.target.id}`;
});
object.addEventListener('hide.bs.modal', function (e) {
if (location.hash == `#m-${e.target.id}`) {
history.back();
}
});
object.addEventListener('shown.bs.modal', function () {
location.hash = "modal";
});
addEventListener('hashchange', function () {
if (location.hash == "#modal") {
const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0])
if (!curr_modal) history.back();
}
else {
if (!location.hash.startsWith("#m-")) {
const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0])
if (curr_modal) curr_modal.hide()
}