diff --git a/files/assets/css/main.css b/files/assets/css/main.css index db315e0b31..440554776a 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -1804,13 +1804,6 @@ button.close { .toast-body { padding: 0.75rem; } -.modal-open { - overflow: hidden !important; -} -.modal-open .modal { - overflow-x: hidden; - overflow-y: auto; -} .modal { position: fixed; top: 0; @@ -1819,7 +1812,8 @@ button.close { display: none; width: 100%; height: 100%; - overflow: hidden; + overflow-x: hidden; + overflow-y: auto; outline: 0; padding-right: 0 !important; /* fix Safari zoom issue */ } @@ -7681,12 +7675,6 @@ ul { } @media (min-width: 768px) { - .modal-open { - padding-right: 10px; - } - .modal-open nav { - padding-right: 10px; - } ::-webkit-scrollbar { width: 10px; } diff --git a/files/assets/js/core.js b/files/assets/js/core.js index cc20903a01..4dd37b10b1 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -1,3 +1,7 @@ +if (location.hash.startsWith("#m-")) { + history.replaceState({}, '', location.href.split('#')[0]) +} + const SITE_FULL_IMAGES = document.getElementById('SITE_FULL_IMAGES').value function getMessageFromJsonData(success, json) { @@ -694,14 +698,18 @@ function enablePushNotifications() { }) } -const body = document.getElementsByTagName('body')[0] -addEventListener('hashchange', () => { - if (location.hash.startsWith("#m-")) - body.classList.add('modal-open') - else - body.classList.remove('modal-open') -}) +addEventListener('wheel', function (e) { + if (location.hash.startsWith("#m-")) { + e.preventDefault(); + e.stopPropagation(); + return false; + } +}, {passive: false}); -if (location.hash.startsWith("#m-")) { - history.replaceState({}, '', location.href.split('#')[0]) -} +addEventListener('touchmove', function (e) { + if (location.hash.startsWith("#m-")) { + e.preventDefault(); + e.stopPropagation(); + return false; + } +}, {passive: false});