forked from rDrama/rDrama
same as last commit
parent
3165489f58
commit
7007daae9b
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue