From 2b9b6e72ed1c24fb2e7efd8751061430701a75c5 Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Sat, 11 Apr 2026 19:06:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A8=E6=80=81=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?Toast=20=E6=8F=90=E7=A4=BA=E6=A1=86=E7=9A=84=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=81=8F=E7=A7=BB=E9=87=8F=EF=BC=8C=E4=BC=98=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sidepanel/sidepanel.css | 2 +- sidepanel/sidepanel.js | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/sidepanel/sidepanel.css b/sidepanel/sidepanel.css index 9582a62..d1dea21 100644 --- a/sidepanel/sidepanel.css +++ b/sidepanel/sidepanel.css @@ -756,7 +756,7 @@ header { #toast-container { position: fixed; - top: var(--toast-top-offset, 12px); + bottom: 12px; left: 12px; right: 12px; z-index: 1000; diff --git a/sidepanel/sidepanel.js b/sidepanel/sidepanel.js index d18d6c0..9e728f9 100644 --- a/sidepanel/sidepanel.js +++ b/sidepanel/sidepanel.js @@ -44,7 +44,6 @@ const btnAutoStartClose = document.getElementById('btn-auto-start-close'); const btnAutoStartCancel = document.getElementById('btn-auto-start-cancel'); const btnAutoStartRestart = document.getElementById('btn-auto-start-restart'); const btnAutoStartContinue = document.getElementById('btn-auto-start-continue'); -const pageHeader = document.querySelector('header'); const STEP_DEFAULT_STATUSES = { 1: 'pending', 2: 'pending', @@ -114,13 +113,6 @@ function dismissToast(toast) { toast.addEventListener('animationend', () => toast.remove()); } -function updateToastOffset() { - if (!toastContainer) return; - const headerBottom = pageHeader?.getBoundingClientRect().bottom ?? 0; - const offset = Math.max(12, Math.ceil(headerBottom + 8)); - document.documentElement.style.setProperty('--toast-top-offset', `${offset}px`); -} - function resetActionModalButtons() { const buttons = [btnAutoStartCancel, btnAutoStartRestart, btnAutoStartContinue]; buttons.forEach((button) => { @@ -1110,13 +1102,7 @@ btnTheme.addEventListener('click', () => { initializeManualStepActions(); initTheme(); -updateToastOffset(); updateSaveButtonState(); -window.addEventListener('resize', updateToastOffset); -window.addEventListener('load', updateToastOffset); -if (document.fonts?.ready) { - document.fonts.ready.then(updateToastOffset).catch(() => { }); -} restoreState().then(() => { syncPasswordToggleLabel(); syncVpsUrlToggleLabel();