From 62d10a989d448d1b350846300896f3f026f1c27c Mon Sep 17 00:00:00 2001 From: nyne Date: Mon, 8 Sep 2025 14:43:54 +0800 Subject: [PATCH] fix UI --- frontend/src/components/popup.tsx | 14 +++++++++++--- frontend/src/pages/resource_details_page.tsx | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/popup.tsx b/frontend/src/components/popup.tsx index 19b76f2..ddba5ff 100644 --- a/frontend/src/components/popup.tsx +++ b/frontend/src/components/popup.tsx @@ -11,10 +11,18 @@ export default function showPopup( const div = document.createElement("div"); div.style.position = "fixed"; - if (eRect.x > window.innerWidth / 2) { - div.style.right = `${window.innerWidth - eRect.x}px`; + if (window.innerWidth > 400) { + if (eRect.x > window.innerWidth / 2) { + div.style.right = `${window.innerWidth - eRect.x}px`; + } else { + div.style.left = `${eRect.x}px`; + } } else { - div.style.left = `${eRect.x}px`; + if (eRect.x > window.innerWidth / 2) { + div.style.right = `8px`; + } else { + div.style.left = `8px`; + } } if (eRect.y > window.innerHeight / 2) { div.style.bottom = `${window.innerHeight - eRect.y}px`; diff --git a/frontend/src/pages/resource_details_page.tsx b/frontend/src/pages/resource_details_page.tsx index d8d4e65..c8ad2a3 100644 --- a/frontend/src/pages/resource_details_page.tsx +++ b/frontend/src/pages/resource_details_page.tsx @@ -728,7 +728,7 @@ function FileTile({ file }: { file: RFile }) { {file.is_redirect ? t("Redirect") : fileSizeToString(file.size)} { -