From 34ac1dec27bfaffbac10fa7de4c77da73fac8072 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 3 Aug 2023 13:52:20 +0300 Subject: [PATCH] same as last commit --- files/assets/js/core.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 5cd3264b5..7f3c8e37d 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -586,18 +586,18 @@ function handleUploadProgress(e, upload_prog) { if (screen_width <= 768) { - document.addEventListener('shown.bs.modal', (e) => { - location.hash = `m-${e.target.id}`; + addEventListener('show.bs.modal', function () { + location.hash = "modal"; }); - - document.addEventListener('hidden.bs.modal', (e) => { - if (location.hash == `#m-${e.target.id}`) { + + addEventListener('hide.bs.modal', function () { + if(location.hash == "#modal") { history.back(); } }); - - window.addEventListener('hashchange', () => { - if (!location.hash.startsWith("#m-")) { + + addEventListener('hashchange', function () { + if(location.hash != "#modal") { const curr_modal = bootstrap.Modal.getInstance(document.getElementsByClassName('show')[0]) if (curr_modal) curr_modal.hide() }