forked from rDrama/rDrama
same as last commit
parent
7051699ffb
commit
34ac1dec27
|
@ -586,18 +586,18 @@ function handleUploadProgress(e, upload_prog) {
|
||||||
|
|
||||||
|
|
||||||
if (screen_width <= 768) {
|
if (screen_width <= 768) {
|
||||||
document.addEventListener('shown.bs.modal', (e) => {
|
addEventListener('show.bs.modal', function () {
|
||||||
location.hash = `m-${e.target.id}`;
|
location.hash = "modal";
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('hidden.bs.modal', (e) => {
|
addEventListener('hide.bs.modal', function () {
|
||||||
if (location.hash == `#m-${e.target.id}`) {
|
if(location.hash == "#modal") {
|
||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('hashchange', () => {
|
addEventListener('hashchange', function () {
|
||||||
if (!location.hash.startsWith("#m-")) {
|
if(location.hash != "#modal") {
|
||||||
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