From a9f9bd9bb1e1380f8cb5fdd210c3f88c852ed47b Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 1 Oct 2023 15:57:34 +0300 Subject: [PATCH] fixes to modal commit --- files/assets/css/main.css | 4 ++-- files/assets/css/themes/classic.css | 2 +- files/assets/css/themes/dark.css | 2 +- files/assets/css/themes/light.css | 2 +- files/assets/js/core.js | 8 +++++--- files/templates/modals/expanded_image.html | 7 +++++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 2b468d90b..afef2ec4e 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5854,7 +5854,7 @@ html { padding: 12px; padding-bottom: 4px; } -*:target { +:not(.modal):target { background: rgba(var(--primary_rgb), 0.15) !important; padding: 12px; padding-bottom: 4px; @@ -7684,6 +7684,6 @@ ul { display: none; } -*:target { +:not(.modal):target { scroll-margin-top: 100px; } diff --git a/files/assets/css/themes/classic.css b/files/assets/css/themes/classic.css index 80a3dce9d..7db6edb0d 100644 --- a/files/assets/css/themes/classic.css +++ b/files/assets/css/themes/classic.css @@ -180,7 +180,7 @@ blockquote a { .unread { background-color: #d9d9d9 !important; } -*:target { +:not(.modal):target { background: rgba(var(--primary_rgb), 0.2) !important; } diff --git a/files/assets/css/themes/dark.css b/files/assets/css/themes/dark.css index f54472dc9..490c4cf1f 100644 --- a/files/assets/css/themes/dark.css +++ b/files/assets/css/themes/dark.css @@ -101,7 +101,7 @@ pre { color: #bbb !important; } -*:target { +:not(.modal):target { background: rgba(var(--primary_rgb), 0.2) !important; } diff --git a/files/assets/css/themes/light.css b/files/assets/css/themes/light.css index 7de8bf4f5..bc97ef34a 100644 --- a/files/assets/css/themes/light.css +++ b/files/assets/css/themes/light.css @@ -79,7 +79,7 @@ blockquote { .unread { background: #dddddd !important; } -*:target { +:not(.modal):target { background: rgba(var(--primary_rgb), 0.2) !important; } diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 02cae3ab2..cc20903a0 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -695,11 +695,13 @@ function enablePushNotifications() { } const body = document.getElementsByTagName('body')[0] -function body_fix() { +addEventListener('hashchange', () => { if (location.hash.startsWith("#m-")) body.classList.add('modal-open') else body.classList.remove('modal-open') +}) + +if (location.hash.startsWith("#m-")) { + history.replaceState({}, '', location.href.split('#')[0]) } -body_fix() -addEventListener('hashchange', body_fix) diff --git a/files/templates/modals/expanded_image.html b/files/templates/modals/expanded_image.html index 6a4d3fc26..563b53132 100644 --- a/files/templates/modals/expanded_image.html +++ b/files/templates/modals/expanded_image.html @@ -1,8 +1,11 @@ +