From 9d1de6ee5aa81e647cef81718dfad94101288499 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 30 Jul 2023 13:15:07 +0300 Subject: [PATCH] fix reporting and giving awards on mobile --- files/assets/js/core.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index f2a40a039..894f7f7c9 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -586,15 +586,17 @@ function handleUploadProgress(e, upload_prog) { if (screen_width <= 768) { - document.addEventListener('shown.bs.modal', () => { - location.hash = "modal"; - }); + if (expandImageModal) { + expandImageModal.addEventListener('shown.bs.modal', () => { + location.hash = "modal"; + }); - document.addEventListener('hidden.bs.modal', () => { - if(location.hash == "#modal") { - history.back(); - } - }); + expandImageModal.addEventListener('hidden.bs.modal', () => { + if(location.hash == "#modal") { + history.back(); + } + }); + } window.addEventListener('hashchange', () => { if(location.hash != "#modal") {