try smth to fix edge case jumps

master
Aevann 2023-08-04 19:28:34 +03:00
parent 64d5687cc3
commit 3165489f58
1 changed files with 5 additions and 1 deletions

View File

@ -604,7 +604,11 @@ if (screen_width <= 768) {
});
addEventListener('hashchange', function () {
if(location.hash != "#modal") {
if (location.hash == "#modal") {
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])
if (curr_modal) curr_modal.hide()
}